Jump to content

Copying Selected Text From Any Browser Window To One Static Page


shobhitjain
 Share

Recommended Posts

I've been working with this recently but it wil only work for IE I thinkthe code might be wrong

<html><head><script type="text/javascript">function Copy(){ var rng = new textRange(); if(rng!=null && rng!="" && rng!=undefined){  cmd = rng.execCommand("copy",false,true);  return cmd; } return false;}function Popup(){ if(Copy()){  var wnd = window.open()  wnd.write(Copy()) } return;}</script></head><body onmouseup="Popup()">This is some text. This is some text. This is some text. This is some text.This is more text. And this is also more text.</body><html>

I'm almost completely positive that execCommand works only in IE, I could be wrong

Edited by Mitchel
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...