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.

Reference: http://msdn.microsoft.com/en-us/library/ie/hh673524(v=vs.85).aspx