470,821 Members | 1,968 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,821 developers. It's quick & easy.

view-source without reload the page

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
3 2397
"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
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
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.

Similar topics

1 post views Thread by js | last post: by
3 posts views Thread by M. Mehta | last post: by
4 posts views Thread by Ryan | last post: by
8 posts views Thread by Jef Driesen | last post: by
10 posts views Thread by Zack Sessions | last post: by
1 post views Thread by Nathan Sokalski | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.