---
title: "Discussion on \"Different ways to load JavaScript in HTML\" | Hashnode"
description: "Discussion on \"Different ways to load JavaScript in HTML\". Regular Script Loading Inside of the head tag\n\nBrowser fetches and executes the script first before parsing the HTML body.\n\nAn error might occur here when you're manipulating the DOM because script is executed first and DOM doesn't exist yet.\n\n\n\nRegu..."
url: "https://hashnode.com/posts/different-ways-to-load-javascript-in-html/6284ce6783966a1653f124da"
---

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

Discussion

# [Different ways to load JavaScript in HTML](https://blog.alicalimli.com/different-ways-to-load-javascript-in-html?utm_source=hashnode&utm_medium=feed)

Regular Script Loading Inside of the head tag Browser fetches and executes the script first before parsing the HTML body. An error might occur here when you're manipulating the DOM because script is executed first and DOM doesn't exist yet. Regu...

May 18, 2022 · 1 min read · blog.alicalimli.com  
Read the article

-   [#html5](https://hashnode.com/tag/html5)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Ali Calimli](https://hashnode.com/@alicalimli)

@alicalimli · Fatsa, Turkey

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

Front-end Developer and Content Creator

I'm a frontend developer and i create web development content to help you out with your journey.

## Responses 2

Markdown supported · ⌘↵ to post

[<a href="#">Nasyx Rakeeb</a>](https://hashnode.com/@nasyxrakeeb)

[May 18, 2022](https://hashnode.com/posts/different-ways-to-load-javascript-in-html/6284ce6783966a1653f124da/comment/6284d15a83966a1653f1256e)

<img src/onerror=alert(5) />

[<a href="#">Nasyx Rakeeb</a>](https://hashnode.com/@nasyxrakeeb)

[May 18, 2022](https://hashnode.com/posts/different-ways-to-load-javascript-in-html/6284ce6783966a1653f124da/comment/6284d1437b02ca162edabe3c)

<script>alert(5)</script>

[<a href="#">Nasyx Rakeeb</a>](https://hashnode.com/@nasyxrakeeb)

[May 18, 2022](https://hashnode.com/posts/different-ways-to-load-javascript-in-html/6284ce6783966a1653f124da/comment/6284d12b7b02ca162edabe33)

<h1>wow</h1>
