---
title: "Discussion on \"Load Javascript Asynchronously 🚀\" | Hashnode"
description: "Discussion on \"Load Javascript Asynchronously 🚀\". Introduction\nA script tag is used to load JavaScript inside a web browser. async and defer are the boolean attributes used along with the script tag to load the scripts faster into the web page. In this article, we will cover the following scenarios ..."
url: "https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Load Javascript Asynchronously 🚀](https://vinitraut.hashnode.dev/load-javascript-asynchronously?utm_source=hashnode&utm_medium=feed)

Introduction A script tag is used to load JavaScript inside a web browser. async and defer are the boolean attributes used along with the script tag to load the scripts faster into the web page. In this article, we will cover the following scenarios ...

Sep 23, 2020 · 4 min read · vinitraut.hashnode.dev  
Updated Feb 16, 2024  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#async](https://hashnode.com/tag/async)
-   [#2articles1week](https://hashnode.com/tag/2articles1week)

## Written by

[Vinit Raut](https://hashnode.com/@vinitraut)

@vinitraut · Mumbai, India

  
[View profile](https://hashnode.com/@vinitraut)

Reading and writing here to document my learnings. If it helps you, that's a bonus! ✨

Reading and writing here to document my learnings ✨

## Responses 7

Markdown supported · ⌘↵ to post

[Edidiong Asikpo (Didi)](https://hashnode.com/@didicodes)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6ca3a35244e74df52a692b)

Ah. I love this article.

Thanks for sharing [Vinit Raut](https://hashnode.com/@vin18).

[fard](https://hashnode.com/@maghfard)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6ca02d5244e74df52a68df)

learned something new today! thnx! But: can you explain for newbies like me the why in "specifying the script tag at the end of the body tag but that's not very efficient"

[Vinit Raut](https://hashnode.com/@vinitraut)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6ca02d5244e74df52a68df#reply-5f6ca74d5244e74df52a69a9)

Thank you for sharing your feedback! By specifying the script at the end of the body tag, the script will be loaded and executed at the end. You can optimize the fetching of scripts while HTML is parsing by specifying `async` and `defer` and also control when they should run.

[Luciano Serruya Aloisi](https://hashnode.com/@LucianoFromTrelew)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6c9a407ad0ce4e1605c710)

Very nice article! Clear and concise. I'd like to ask if both properties `async` and `defer` could be used on the same `script` tag

[Vinit Raut](https://hashnode.com/@vinitraut)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6c9a407ad0ce4e1605c710#reply-5f6ca7b25244e74df52a69b3)

I am glad you liked the article! You can use both simultaneously but is not recommended. `async` has a higher priority than `defer`. Depending upon the use case and dependencies of the scripts, you can use `async` and `defer` accordingly.

[Chris Bongers](https://hashnode.com/@dailydevtips)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6c5dd2136a1642fa93b26d)

Nice article! Good understanding between async and defer.

[Vinit Raut](https://hashnode.com/@vinitraut)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6c5dd2136a1642fa93b26d#reply-5f6c5ef8136a1642fa93b281)

Hey, [Chris Bongers](https://hashnode.com/@dailydevtips). Thank you for sharing your feedback! :)

[Tapas Adhikary](https://hashnode.com/@atapas)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6c59c5136a1642fa93b20d)

Good one [Vinit Raut](https://hashnode.com/@vin18)!

[Vinit Raut](https://hashnode.com/@vinitraut)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6c59c5136a1642fa93b20d#reply-5f6c5c66136a1642fa93b24d)

Thank you [Tapas Adhikary](https://hashnode.com/@atapas). Really appreciated your feedback before I published this article. :)

[Saurabh Mhatre](https://hashnode.com/@saurabhmhtr)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6c4336136a1642fa93b08e)

Nice article. Learnt something new today about script tags. It feels good to read such short but information packed articles. Keep it up.

[Emily Boston](https://hashnode.com/@emilyboston)

[Sep 24, 2020](https://hashnode.com/posts/load-javascript-asynchronously/5f6b919361f6923cac7c04ac/comment/5f6c2b65136a1642fa93af68)

Nicely explained, [Vinit Raut](https://hashnode.com/@vin18). Thank you.
