homepage Welcome to WebmasterWorld Guest from
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?

 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?



 2:02 am on Jun 3, 2006 (gmt 0)

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


 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?


 11:49 am on Jun 3, 2006 (gmt 0)

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


 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.

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.


 2:11 pm on Jun 5, 2006 (gmt 0)

No problem, everything is welcome.


 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