[thelist] IE, Javasript, and Textranges

.jeff jeff at members.evolt.org
Tue Aug 27 16:40:01 CDT 2002


joshua,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Joshua Olson
>
> I'm using a text field as a go between on an IE only
> page so that I can construct a string and copy it to
> the users clipboard.  The code sorta looks like this:
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

i've not had very good luck with the exec() method to copy contents to the clipboard.  since you're using ie-only, may i suggest you look into the clipboardData object and the setDate() method.

window.clipboardData.setData('Text', string_im_building);

i've successfully copied strings with tabs, new lines, and all sorts of other characters and had it all retained exactly as i constructed it.

clipboardData object (watch wrap):
<http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/clipboarddata.asp>

setData() method (watch wrap):
<http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/setdata.asp>

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list