Newbie to ASP

Discussion in 'ASP General' started by Andy, Oct 5, 2004.

  1. Andy

    Andy Guest

    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.
    Andy, Oct 5, 2004
    #1
    1. Advertising

  2. Andy

    Evertjan. Guest

    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.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Oct 5, 2004
    #2
    1. Advertising

  3. Andy

    Andy Kasotia Guest

    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.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Andy Kasotia, Oct 5, 2004
    #3
  4. Andy Kasotia wrote:
    > 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
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Oct 5, 2004
    #4
  5. Andy

    Evertjan. Guest

    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.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Oct 5, 2004
    #5
  6. "Andy Kasotia" <> wrote in message
    news:e9I$...
    > 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?
    }

    > Thank you,
    > Andy.
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Stephanie Stowe, Oct 5, 2004
    #6
  7. Andy wrote:
    > 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.
    Dave Anderson, Oct 5, 2004
    #7
  8. Andy

    Andy Kasotia Guest

    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.




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Andy Kasotia, Oct 5, 2004
    #8
  9. Andy

    Bob Lehmann Guest

    Top to Bottom.

    Bob Lehmann

    "Andy Kasotia" <> wrote in message
    news:...
    > 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.
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Bob Lehmann, Oct 5, 2004
    #9
  10. "Andy Kasotia" <> wrote in message
    news:...
    > 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.



    > 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.
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Stephanie Stowe, Oct 5, 2004
    #10
  11. "Bob Lehmann" <none> wrote in message
    news:...
    > 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.
    Stephanie Stowe, Oct 5, 2004
    #11
  12. Andy

    Andy Kasotia Guest

    Thank you all for your time and input. I sincerely appreciate it.

    Andy.


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Andy Kasotia, Oct 5, 2004
    #12
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Id0x
    Replies:
    4
    Views:
    1,187
    Erik Max Francis
    Jul 21, 2003
  2. JohnE

    newbie with newbie questions

    JohnE, Aug 17, 2009, in forum: ASP .Net
    Replies:
    3
    Views:
    494
    Gregory A. Beamer
    Aug 17, 2009
  3. Jerry C.
    Replies:
    8
    Views:
    229
    Uri Guttman
    Nov 23, 2003
  4. Kruno Saho
    Replies:
    0
    Views:
    134
    Kruno Saho
    Apr 7, 2013
  5. Dave Angel
    Replies:
    0
    Views:
    118
    Dave Angel
    Apr 7, 2013
Loading...

Share This Page