Welcome to WebmasterWorld Guest from 54.162.226.212

Forum Moderators: open

Message Too Old, No Replies

Revealing html from javascript?

How to see the source?

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

10+ Year Member



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)

10+ Year Member



With the Web Developer extension for Firefox you can view generated source
8:08 am on Jun 3, 2006 (gmt 0)

10+ Year Member



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)

10+ Year Member



If I wasn't entirely clear, maybe this post was more outlined: [webmasterworld.com...]
1:55 pm on Jun 5, 2006 (gmt 0)

5+ Year Member



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.

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

10+ Year Member



No problem, everything is welcome.
6:44 pm on Jun 5, 2006 (gmt 0)

10+ Year Member



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 :)

 

Featured Threads

Hot Threads This Week

Hot Threads This Month