Jump to content

Copying Selected Text From Any Browser Window To One Static Page


shobhitjain

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...