M
melvynm
Currently I'm trying to make a plugin for my browser (Maxthon/IE6)
which allows me to select any text on the current page and press the
plugin button to create a new tab with the selection.
This will do the job:
<script language="JavaScript">
javascript:r4NSy3m=document.selection.createRange();oDgs2Ke=r4NSy3m.text;dT30FfN=new
Date();wdGs8c6=window.open('','w'+dT30FfN.getTime(),'');wdGs8c6.document.write(oDgs2Ke);
void(wdGs8c6.document.close())
</script>
Unfortunately, I want to retain the layout of the text and the above
code strips it out.
The code on http://www.webreference.com/js/column12/crossbrowser.html
seems to do precisely what I want but it displays the current selection
in a box on the page. I'm not interested in using 'onmouseup' as I want
to decide when the page should open.
Can someone please show me how to make the webreference example work in
a new page on demand.
which allows me to select any text on the current page and press the
plugin button to create a new tab with the selection.
This will do the job:
<script language="JavaScript">
javascript:r4NSy3m=document.selection.createRange();oDgs2Ke=r4NSy3m.text;dT30FfN=new
Date();wdGs8c6=window.open('','w'+dT30FfN.getTime(),'');wdGs8c6.document.write(oDgs2Ke);
void(wdGs8c6.document.close())
</script>
Unfortunately, I want to retain the layout of the text and the above
code strips it out.
The code on http://www.webreference.com/js/column12/crossbrowser.html
seems to do precisely what I want but it displays the current selection
in a box on the page. I'm not interested in using 'onmouseup' as I want
to decide when the page should open.
Can someone please show me how to make the webreference example work in
a new page on demand.