Newbee to Web-programming

A

Andy

After the server processes the page, the server sends a rendered
HTML/text/Script client-side code down to the browser. I'm wondering
how (in what order) does the browser interpret the text document. Does
the browser do the HTML first and then anything between the script
tags or is it the other way around. What would be the sequence of
events in IE and in Netscape?

I would appreciate if someone can shed some light on this.

Thank you,
Anand.
 
R

Randy Webb

Andy said:
After the server processes the page, the server sends a rendered
HTML/text/Script client-side code down to the browser. I'm wondering
how (in what order) does the browser interpret the text document. Does
the browser do the HTML first and then anything between the script
tags or is it the other way around. What would be the sequence of
events in IE and in Netscape?

Unless explicitly told to do it differently, it processes it in the
order its sent to the browser.
 
L

Lasse Reichstein Nielsen

After the server processes the page, the server sends a rendered
HTML/text/Script client-side code down to the browser. I'm wondering
how (in what order) does the browser interpret the text document. Does
the browser do the HTML first and then anything between the script
tags or is it the other way around.

Generally, the browser parses the HTML from the begining, and when it
meets a script element, it executes the script at that point. That is
why "document.write" inserts its content right after the script
element.

Accessing parts of the page already parsed, might be possible, but
since the DOM has not been fully build, I would not feel absolutely
certain about accessing it before the page has loaded.

If you give a script element the attribute "defer", then the browser
is allowed to defer execution of that script until later, but no later
than the execution of the next script element on the page.
What would be the sequence of events in IE and in Netscape?

I believe they agree completely about the order, as does all other
scriptable browsers.

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top