The moose likes HTML, CSS and JavaScript and the fly likes General Question about where code in a JavaScript goes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "General Question about where code in a JavaScript goes" Watch "General Question about where code in a JavaScript goes" New topic
Author

General Question about where code in a JavaScript goes

Wilson Mui
Ranch Hand

Joined: Apr 09, 2003
Posts: 140
I am a newbie in javascripts and the whole DOM model. I am just wondering where the dynamic html code that you created go exactly. What I mean is that if I look at the source file of an .html page it won't have the code that I create dynamically in there. Exactly where does the browser store the dynamic code? Is the browser actually displaying then some cached version of the webpage which is constantly being updated by the javascript?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
You can not view the code by hitting view source since the view source looks just at the orginal core document. To see all of the dynamic stuff that was written out you need to look at the body's innerHTML.
Here are two ways to do it. Paste the line into the address bar of the page that you want to see the cde of.
FOR IE you can use

which will paste the code into your clipboard
for all browsers you can use this

which will make a text area with the code
See if this helps you out...
Eric
 
 
subject: General Question about where code in a JavaScript goes
 
Threads others viewed
JSTL tag c:if
Metric Convertor......Pls check the code
Problem in Parsing XML String
Setting up Java
How can I include a JavaFX 2.0 application into a HTML page?
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture