O'Reilly logo

Mobile Web Performance Optimization by S. Niranga

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Opening connection

When you load a JavaScript file synchronously in the Head tag of an HTML page, other requested files have to wait until the JavaScript file gets downloaded. This is more visible to the end-user because, he cannot see any content until all the files in the HEAD area get downloaded. However, using the asynchronous method to download the file we can resolve this issue to some extent.

When we specify JavaScript files to be loaded in the HEAD section of the HTML, it is essential to know the two different ways that we can use to load the data, which are as follows:

  • Synchronous: The requested file will load before the parsing of the page continues
  • Asynchronously: The other requested files will be downloaded parallel to the requested file ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required