Newbie to ASP

A

Andy

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

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

Thank you,
Anand.
 
E

Evertjan.

Andy wrote on 05 okt 2004 in microsoft.public.inetserver.asp.general:
After the server processes the page, the server sends a text document
down to the browser. I'm wondering how (in what order) does the
browser interpret the text document. Does it do the HTML first and
then anything between the script tags or is it the other way around.

ASP does not know or care what a browser does with the document.

So you are asking the wrong NG.
As you are a self proclaimed ASP newbee we (? I hope) forgive you.
 
A

Andy Kasotia

Evertjan,

You probably misunderstood my question. I understand that ASP doesn't
know or care about what the browser does. That was not my question. I'm
just asking how the browser interprets the text document sent by the
server. What code in the text document does it execute first, the HTML
or the Scripts?

Thank you,
Andy.
 
B

Bob Barrows [MVP]

Andy said:
Evertjan,

You probably misunderstood my question. I understand that ASP doesn't
know or care about what the browser does. That was not my question.
I'm just asking how the browser interprets the text document sent by
the server.

Which makes this a message more suited for a browser newsgroup, doesn't it?
Nothing to do with server-side ASP code, which is the focus of this
newsgroup.
What code in the text document does it execute first, the
HTML or the Scripts?

I suspect the answer to this may be dependant on the browser that is being
used.

I really don't know the answer to this for sure, but my first thought would
be to go search the library at msdn.microsoft.com/library in the Web
Development section. This may get you an IE-specific answer. For Mozilla and
Netscape, you should find newsgroups devoted to those browsers. Or try
comp.lang.javascript.

Bob Barrows
 
E

Evertjan.

Andy Kasotia wrote on 05 okt 2004 in
microsoft.public.inetserver.asp.general:
You probably misunderstood my question. I understand that ASP doesn't
know or care about what the browser does. That was not my question. I'm
just asking how the browser interprets the text document sent by the
server. What code in the text document does it execute first, the HTML
or the Scripts?

Hi, Andy,

I don't think I misunderstood.

You are asking what a browser does to a ASP file?

A: The ASP file does not reach the browser.

Or are you asking what a browser does
to the rendered html/text/clientside-code?

A: That is off topic, since this is an ASP [=serverside code] NG.

I would suggest you ask a clientside group.
 
S

Stephanie Stowe

Andy Kasotia said:
Evertjan,

You probably misunderstood my question. I understand that ASP doesn't
know or care about what the browser does. That was not my question. I'm
just asking how the browser interprets the text document sent by the
server. What code in the text document does it execute first, the HTML
or the Scripts?

There are 2 types of script, script that is intended to run on the client
and scripts intended to run on the server. If I have

<%
response.write "<P>This is a paragraph.</P>"
%>

What is actually sent to the browser is

<P>This is a paragraph.</P>

If I put

<script language=javascript>
function testMe() {
window.alert("I am a test");
}

then this script would be executed according to how it was constructed. In
this case, this is a function and would need to be called by something else,
body onload, button click or something.

The server side code is executed and resultant text is sent to the browser.

Does this answer your question?
}
 
D

Dave Anderson

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

Small detail here -- the server does not necessarily send the browser a text
file:

Response.Redirect(SomeOtherURL)
Response.BinaryWrite(BinaryContent)

As for [content-type=text/html], the browser parses the document in the same
order as it would any *static* HTML document.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
A

Andy Kasotia

Hi Stephanie,

Thank you for replying to my message. I understand about the two scripts
you've mentioned. What I was wondering about is that after the Server
has processed the Request and it sends down a rendered html/text file to
the browser, the text file has HTML code as well as code that is
surrounded by <SCRIPT>...</SCRIPT> tags. I just want to know the
sequence in which the browser interprets this text file...does it do all
the HTML first and then do whatever is between the <SCRIPT> tags or is
it the other way around or does it do top to bottom?

I understand that this is probably not a question for this newsgroup but
this is an explanation of what I'm asking since you replied to my
message. If you wish to not answer since I'm in the wrong newsgroup,
I'll understand that.

Thanks though for your response.
Andy.
 
S

Stephanie Stowe

Andy Kasotia said:
Hi Stephanie,

Thank you for replying to my message. I understand about the two scripts
you've mentioned. What I was wondering about is that after the Server
has processed the Request and it sends down a rendered html/text file to
the browser, the text file has HTML code as well as code that is
surrounded by <SCRIPT>...</SCRIPT> tags. I just want to know the
sequence in which the browser interprets this text file...does it do all
the HTML first and then do whatever is between the <SCRIPT> tags or is
it the other way around or does it do top to bottom?

Basically, the answer to this is that the browser expects things to come to
it in a certain standard depending on the browser. The HTML contains
elements and those elements may have events. So <Body onload=testMe();> the
testMe() function will be *executed* when the body loads. You probably need
a short course in client-side scripting.

The browser is sort of a dumb animal. It does not so much evaluate as react.
So it is not like the browser parses the page in an intelligent way.

I hope I did not confuse more than I helped.
 
S

Stephanie Stowe

Bob Lehmann said:
Top to Bottom.

Ha. That's true. My answer is wrongish. I am such in the habit of responding
to input that I did not even think. Sorry Andy, listen to Bob.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top