/    Sign up×
Community /Pin to ProfileBookmark

Page Source…

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

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@swonDec 23.2002 — How did you do it in IE?
Copy linkTweet thisAlerts:
@AdamBrillauthorDec 23.2002 — Here's my code:

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

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?
Copy linkTweet thisAlerts:
@swonDec 23.2002 — Huh, I got no idea how to make it on NS, sorry ?
×

Success!

Help @AdamBrill spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...