Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing Source 1

Status
Not open for further replies.

JavaDude32

Programmer
Aug 25, 2001
180
US
Well I'm debugging a page and I would like to look at the result of the javascript functions in the page. This includes source changes and modification of HTML through javascript. Plain View Source doesn't cut it as it is only showing me the result of the page after the server side script but before the client side scripting. Can anyone help me out here with a command or tool to view the dynamic source output?
 
Try typing this into the address bar (whilst viewing the page) to show the current HTML for the page currently being viewed:

Code:
javascript:alert(document.body.innerHTML);

You could even save that as a bookmark and utilise it from the toolbar directly.

You could also alert the javascript variables in the page using this technique.

Jeff
 
Unfortunately, that's the way it has to be. The browser can only show what is sent to it and server-side scripts almost exclusively are eliminated from this because they contain code that the browser doesn't understand.

Depending on what scripting language you're using, you could possibly provide some break points or alerts that show the values of certain objects and/or variables.

There's always a better way. The fun is trying to find it!
 
Thank you, document.body.innerHTML was what I needed. I understand that I can't show the server side points but this will work for the client side modifications :).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top