top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Difference between <script>, <script async> & <script defer>.

+2 votes
Difference between <script>, <script async> & <script defer>.
posted Jan 22, 2015 by Vrije Mani Upadhyay

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
Best answer

HTML5: async, defer

In HTML5, you can tell browser when to run your JavaScript code. There are 3 possibilities:

<script       src="myscript.js"></script>

<script async src="myscript.js"></script>

<script defer src="myscript.js"></script>

① Without “async” or “defer”, browser will run your script immediately, before rendering the elements that's below your script tag.

② With “async” (asynchronous), browser will continue to load the HTML page and render it while the browser load and execute the script at the same time.

③ With “defer”, browser will run your script when the page finished parsing. (not necessary finishing downloading all image files. This is good.)

answer Feb 12, 2015 by Rahul Singh
Similar Questions
+1 vote

i want to create a chrome extension. its have complex mathematical queries. so i need to use python as scripting language. help me to implement python script in google chrome addon

+3 votes

I am trying to debug a javascript file, which is used in a .jsp file. When I debug the using F12 in IE10 I did not find that particular file in the debugger tool.

Can anybody please tell, why that particular file is not showing even it is present in project folder location?

+3 votes

I am trying to upload files through html page in our Windows based server but I don't know how to take the files on remote server & save files there