preserving html tags in a selection w/Safari

N

Nick

I'm trying to teach myself a little javascript on the mac, and in the
course of doing so, I decided to try to create a bookmarklet to open a
selected area of text in a new window (Using Safari 1.0.1). This is
easy enough to accomplish, but I'd like to preserve the html markup
of the selected text. To my knowledge, createRange() doesn't work with
Safari, and I can't think of a way to do it. Here's what I have;

javascript:eek:utText=getSelection();if(!outText){void(0)};if(outText){newwindow=window.open('','selectionWindow','width=800,height=600');newwindow.document.write('<body>'+outText+'</body>');newwindow.document.close()}

Is there a means of replacing getSelection() with something that will
preserve the html tags within the selection??

Thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top