Current time: 06-01-2020, 01:26 PM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Asynchronous Javascript
08-17-2012, 11:36 PM
Post: #2
RE: Asynchronous Javascript
Any chance you have a link to a test result you're willing to share?

For starters, async javascript will block onload for all modern browsers (IE < 9 I believe being the main case where it does not) so loading the scripts async just lets the browser load them in parallel without blocking the DOM parser but depending on when you initiate the async load it could actually make load times longer (by starting to load asynchronously later). With async scripts you're actually better off kicking them off earlier and just letting them do their thing in parallel with the rest of the page loading activities.

Depending on how complicated the page is, the browser's parser might actually be getting to the end of the HTML really quickly. Any images it encounters along the way are just scheduled to be loaded and the parser continues on with the DOM. If you use Chrome or Firefox as a test agent you will see a pink vertical bar that is the DOM Content ready event which is basically the point in time where the parser finished building the DOM and made it to the end of the html.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
Asynchronous Javascript - trapezeartist - 08-17-2012, 01:09 AM
RE: Asynchronous Javascript - pmeenan - 08-17-2012 11:36 PM
RE: Asynchronous Javascript - pmeenan - 08-18-2012, 06:11 AM

Forum Jump:

User(s) browsing this thread: 1 Guest(s)