Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • async attribute is javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 266
    Comment on it

    Hi All,

    In this blog we will discuss about the async attribute is javascript, which is a boolean type of attribute that's either can be true or false and when ever we use this attribute to any script tag, it simply denotes that the available script will be executed asynchronously.


    We generally use this attribute whenever we tries to load or add external script file in our project and after loading it we want to execute some function present in that file only.


    If async attribute is added to any script attribute , than the script will be executed while the page continues the parsing. This attribute is supported by all the modern browser like Chrome, Firefox and IE etc, and this attribute is also supported by the HTML5 as well.


    async attributes does not effect on in-line scripts and whenever we are using the async attribute to any script tag that loads any external file, we are basically telling to browser that I don't want the him to stop or break what it's currently doing while it's downloading this particular script.

    Ex.

    <script src="myJsFile.js" async>
    

    Happy Coding....

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: