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;
javascriptutText=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!
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;
javascriptutText=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!