Archive results for:

JavaScript Tip: async and defer attribute

Two new HTML5 attributes for the <script> element, which are supported by IE10, Chrome, Firefox and Safari, will contribute to improving a web page’s speed:

  • async attribute:¬†Enables developers to indicate that a script file should be loaded asynchronously, run when available, and not block page loading.
  • defer attribute:¬†Allows developers to dictate that a script file is to be run when the DOM is loaded and not to block the page.