By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,727 Members | 757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,727 IT Pros & Developers. It's quick & easy.

view-source without reload the page

P: n/a
Dear everyone,

I'd like to know if 'view-source' in javascript can work without
reloading the page. (or not calling the page again, just as I
right-click in IE)

Thanks for your help!

micchy
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"micchy" <mi****@yahoo.com> wrote in message
news:bf**************************@posting.google.c om...
I'd like to know if 'view-source' in javascript can work
without reloading the page. (or not calling the page again,
just as I right-click in IE)


There is no "view-source" in JavaScript so what you are doing must be
some scripted attempt to view some source or another. But without seeing
how you are going about this it is impossible to see why it is reloading
the page or how it could be done differently to avoid that.

The wild speculation would be that it is the usually failing to return
false from the code within an onclick attribute of a line with a "#"
HREF.

Richard.
Jul 20 '05 #2

P: n/a
Richard,

Thanks for your help! I am trying to make use of this:
http://www.javascript-page.com/view-source.html

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

P: n/a
micchy wrote on 16 jan 2004 in comp.lang.javascript:
I'd like to know if 'view-source' in javascript can work without
reloading the page. (or not calling the page again, just as I
right-click in IE)


<a href="#"
onclick="location.href='view-source:'+location.href">
View-source</a>

<br>

<a href="#"
onclick="w=window.open('');
w.document.body.innerText=document.body.outerHTML. replace(/</g,'\n<')">
View-body</a>

[be(a)ware of extra linebreaks]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.