Connect With Us

ads

Friday, 4 November 2016

What are Deffered Scripts in Java Scripts

                 What's  are the problem with normal scripts ?



  • Browser must halt parsing the html until the scripts is downloaded  and executed (since the script might call document.write(...) or define global variable that are later scripts depend on ) 
  • Any images and style sheets that follow the script tag don't start downloading and executing. 
       A defer  external Scripts will start downloading immediately but won't execute until after the                   page is rendered.
       After the page has rendered , all defer scripts are executed in the same order that they were         declared. Not all browser implement defer the same way .
       The purpose of defer is to indicate that a script won't changing the structre of the page as it         executes

No comments

Post a Comment