Click to See Complete Forum and Search --> : Page Source...


AdamBrill
12-22-2002, 07:30 PM
I want to get the source of the page that I am on into a javascript variable. Is there any way to do this? I found a way to do it in Internet Explorer, but I want it to work in Netscape, too. Thanks... Adam

swon
12-22-2002, 07:34 PM
How did you do it in IE?

AdamBrill
12-22-2002, 08:14 PM
Here's my code:


<HTML>
<HEAD>
</HEAD>
<BODY>
<IE:DOWNLOAD id=oDownload style="BEHAVIOR: url(#default#download)">
</IE:DOWNLOAD>
<Script language=javascript>
oDownload.startDownload(window.location,test);
function test(code)
{
alert(code);
}
</Script>
</BODY>
</HTML>

The variable code has the code for the page in it. I tried to have it print it to the screen(with document.write(code);), but it didn't work. Any idea why that didn't work???

And, is there any way to get that to work in Netscape?

swon
12-22-2002, 09:03 PM
Huh, I got no idea how to make it on NS, sorry :(