homepage Welcome to WebmasterWorld Guest from 23.20.61.85
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Revealing html from javascript?
How to see the source?
activeco

10+ Year Member



 
Msg#: 5522 posted 11:05 pm on Jun 2, 2006 (gmt 0)

Besides DOM Inspector, what would be other ways to get source code of embedded html documents in javascript?

 

outrun

10+ Year Member



 
Msg#: 5522 posted 2:02 am on Jun 3, 2006 (gmt 0)

With the Web Developer extension for Firefox you can view generated source

activeco

10+ Year Member



 
Msg#: 5522 posted 8:08 am on Jun 3, 2006 (gmt 0)

Thanks Outrun.
Actually, in Firefox I can view it by simply selecting anything on the page (or Ctrl-A) and using "View Selection Source".

Is there any way, in any language, to get the code automatically and save the file?

activeco

10+ Year Member



 
Msg#: 5522 posted 11:49 am on Jun 3, 2006 (gmt 0)

If I wasn't entirely clear, maybe this post was more outlined: [webmasterworld.com...]

texmex

5+ Year Member



 
Msg#: 5522 posted 1:55 pm on Jun 5, 2006 (gmt 0)

You could probably do it with a javascript bookmarklet. search out the script tags, and document.write their .data properties into a new window.

Edit:
Oops, sorry. After a re-read of the original post, I realise you are after the complete oposite of what I'm suggesting. (you want to capture the HTML content, generated by javascript). Please disregard this post.

activeco

10+ Year Member



 
Msg#: 5522 posted 2:11 pm on Jun 5, 2006 (gmt 0)

No problem, everything is welcome.

JasonD

10+ Year Member



 
Msg#: 5522 posted 6:44 pm on Jun 5, 2006 (gmt 0)

javascript:'<code><ol><li>'+(document.documentElement¦¦document.body).outerHTML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/ /g,"&nbsp;").replace(/\n/g,"<li>")+'<\/ol><\/code>';

Saved as a bookmarklet will render not just the html but the JS within the HTML that makes more JS etc etc etc. I have some others too that some people may prefer but they are at work and I aint :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved