website loading order.
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.
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
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!
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.
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
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)