dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: How do Browsers render content..?

  1. #1
    Join Date
    Feb 2012
    Posts
    2

    Lightbulb How do Browsers render content..?

    Hy all,

    2 places to place the <scripts>
    1) <header>
    2) <body> (at the end)

    If scripts are placed as in 1) Browsers might not load the rest of the document unless the whole of <script>'s loaded, as it might have some document changing stuff.

    For a better performance, if all the heavy scripts are placed as in 2), enabling all the document content to load first, though the DOM is ready, even in this case Browsers have to load all the scripts right, before rendering the content?? (as script might have some document changing stuff.)

    So does placement of the <script> tag really matter? Please clarify.

  2. #2
    Join Date
    Nov 2007
    Posts
    432
    You want your libraries to first... put them in the HEAD.

    examples...
    Your content has an "onclick" event defined, if the user clicks it before the library with that function is loaded, you just caused an error.

    Supposing your scenario where the library loads slowly and the page has some DOM manipulation that is supposed to happen when the page loads. Do you want the user to see the "base" content? Probably not... you are manipulating the DOM for a reason.

  3. #3
    Join Date
    Feb 2012
    Posts
    2
    That case placement of the scripts wont' matter?

    I mean in both ways all the script/s should be downloaded to the client, then parsed(DOM) and rendered on UI?

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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