Hi Walter -

I completely understood what you meant. I have a strange situation
here. My enitre design sits on top of the DOM for lateral processing.
As soon as the DOM gets updated, there will be sequence of java script
calls based on the elements generated on this DOM for form processing.
After I heard that I cannot get the DOM state at the source code
level, I will probably take a look at other design issue. This is
something I never expected...


On Sep 21, 9:48 am, Walter Lee Davis <wa...@wdstudio.com> wrote:
> There's a fundamental difference between the source code and the  
> current state of the DOM. The former is fixed at the time that your  
> server sends it. And once that source is sent to the browser, the  
> browser interprets it and generates the DOM, which it uses to create  
> the on-screen display of the **current** state of the DOM.
> Anything you do later to modify the DOM causes the DOM itself to  
> change, and thus the screen to update, but does not update the source  
> you see in your browser. Think of the source as the score, and the DOM  
> as the orchestral performance. The conductor and orchestra is  
> JavaScript, then, to stretch the metaphor.
> When you request an element by its ID, you are "asking" the DOM, not  
> the source. When you modify an element on screen, or update it to  
> contain entirely new content, you are modifying the DOM, not the page  
> source.
> <div id="foo">something here</div>
> JavaScript:
> $('foo').addClassName('bar');
> console.log($('foo').hasClassName('bar')) //=> true
> $$('.bar').invoke('insert',' with classname bar');
> console.log($('foo').innerHTML) //=> something here with classname bar
> At no point above, if you looked in the source, would you see that  
> #foo now was #foo.bar, or that its content had changed, unless you  
> were using a tool such as Firebug to inspect the current state of the  
> DOM.
> Walter
> On Sep 21, 2009, at 9:22 AM, Kumar wrote:
> > Hi Tj -
> > Thanks for the prompt response. It really amazed me, when I heard that
> > I can see source code of the original document and not the later
> > things that got updated through the Ajax updater. We have this
> > dependency where we need to make series of Java script calls based on
> > the dynamic response created by the Ajax updater. That includes the
> > dynamically generated element id's and stuff. If these are not going
> > to be visible in generated source, how am I supposed to make
> > advantage. Is there a way, though prorotype Ajax ?
> > Thanks
> > On Sep 19, 8:21 am, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
> >> Hi,
> >> "View source" will only show you the original source of the document,
> >> not any later modifications you make to the DOM (e.g., via
> >> Ajax.Updater or any of several other means).  Why does it matter?
> >> What is it you're trying to achieve looking at the source?  If it's
> >> just that you're trying to debug the markup or something, you can use
> >> Firefox with the Firebug[1] add-on, which will show you the current
> >> DOM tree rather than the original source.
> >> [1]http://getfirebug.com/
> >> HTH,
> >> --
> >> T.J. Crowder
> >> tj / crowder software / comwww.crowdersoftware.com
> >> On Sep 18, 11:27 pm,Kumar<kumar.k.re...@gmail.com> wrote:
> >>> Hi All -
> >>> I am using prototype Ajax updater. The main intenntion of using
> >>> updater is to show users a loading icon, but in background we are
> >>> making a series webservice calls to wide variety of systems, then
> >>> collabarate all the data to users at one go.
> >>> The page loads and calls ajax updater. Updater inturn updates a div
> >>> tag with a search results. (results are processed in another jsp
> >>> page). Here is the problem. After the entire page gets loaded with
> >>> results, when I see the source I do not see the results grid in the
> >>> source page. I know its just the code that got loaded while making
> >>> ajax calls. How can I induce the code in to the same source file  
> >>> after
> >>> the ajax call.
> >>> Did any one face this issue before. if you have any thoughts, please
> >>> share it across. Please shoot me an email, if you are still not  
> >>> clear
> >>> with the issue.
> >>> Thanks- Hide quoted text -
> >> - Show quoted text -- Hide quoted text -
> - Show quoted text -
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to