shobhitjain Posted November 3, 2009 Share Posted November 3, 2009 Hey guys i want a feature that whenever i select any text from any browser's page ,it get copied to a small pop-up like window or my static page.please help guys. i am not getting any idea of it. Link to comment Share on other sites More sharing options...
heldplayer Posted November 6, 2009 Share Posted November 6, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.