www.webdeveloper.com
Results 1 to 5 of 5

Thread: website loading order.

  1. #1
    Join Date
    May 2007
    Posts
    20

    website loading order.

    Hi

    I have a website that is written using cgi/perl, html, js, css. I would like to know how the webpage loads in the browser? Will it load in the same order it is coded?or which one has more priority and whether it will be browser dependable?Please let me know if I need to be more clear.

    Thanks
    pragan

  2. #2
    Join Date
    Nov 2007
    Posts
    17
    All HTML documents load from top to bottom. CSS loads in the order it is called, but it has special rules about what overwrites what and what rules are more important than other rules. LINK
    JavaScript that is embedded in an HTML doc gets run as soon as its loaded.
    Now CGI/Perl I am not entirely sure how it runs as I have not dealt with it really. I would assume it loads as it is called, unless its an interpreted language like PHP. PHP is ran before the page is actually loaded on the client machine. The end user just gets to see the pretty page and none of the code.

    I hope that helps!

  3. #3
    Join Date
    Aug 2007
    Posts
    3,767
    Server-side languages are called first, before the page loads. Then the output of the server-side script is sent to the browser as HTML. If you view the page source, you'll see what I mean.

    Everything else is done in top to bottom order then.

    The only important thing to grasp is that while server-side scripts and client-side scripts are called from top to bottom, the server-side ones are done first on the server before the browser gets any content, and then the output of server-side scripts is sent to the browser to be executed.
    Great wit and madness are near allied, and fine a line their bounds divide.

  4. #4
    Join Date
    May 2007
    Posts
    20
    hi

    thanks a lot to both of you. I have one general question before I am convinced
    If my code(.cgi) is written like this:
    perl code - Includig header/navbar/footer
    perl code - db connection.
    perl code - some coding
    html code - css/js includes
    html code - using the perl variables here and there to show the content/footer

    So in the above scenario, the perl code is executed first and then the output is shown in the browser as html then its followed/loads the html code sections(js/css...)?

    please clarify it

    thanks
    pragan.

  5. #5
    Join Date
    Aug 2007
    Posts
    3,767
    All the Perl is executed first from the top down, and then the browser executes the HTML. If you want to see what the browser does, view the page source in the browser. View -> Page Source, and I think CTRL + u is the shortcut in Firefox anyway. On the HTML side, JavaScript and CSS are loaded as they appear in the page.
    Great wit and madness are near allied, and fine a line their bounds divide.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles