Why JavaScript Inside HTML is a Bad Idea

preview_player
Показать описание
Comes from the video tutorial on how to build a life-changing app:

And in the meantime, don't take my word for why you should never inline JavaScript and see what Jackie Chan's grandmother has to say about this:

Hello my dear ones,

I am Jackie Chan's grandmother, and I want to share with you today why it's important to avoid inlining JavaScript in your HTML.

Firstly, let me tell you a little bit about myself. I come from a time where technology was not as advanced as it is today. But even in those days, we understood the importance of keeping different things separate. For example, we didn't mix our vegetables with our meat because we knew that each had its own flavor and texture. Similarly, it's important to keep our HTML and JavaScript separate.

Nowadays, with the internet being such an important part of our lives, we need to be extra careful about how we use it. Inlining JavaScript in HTML can create security vulnerabilities. When we write JavaScript code in HTML, it becomes accessible to anyone who can see the code. This means that if there are any vulnerabilities in the JavaScript code, anyone with access to the code can exploit it.

Another reason to avoid inlining JavaScript in HTML is that it can make the code more difficult to maintain. When we mix JavaScript and HTML code, it becomes harder to find and fix bugs. It's much easier to maintain code that is neatly organized and separate.

Furthermore, when we separate our JavaScript and HTML code, it becomes easier to reuse the code in different parts of our website. This means that we can save time and effort in the long run by not having to rewrite the same code over and over again.

In conclusion, my dear ones, I hope that you will heed my advice and avoid inlining JavaScript in your HTML. By keeping things separate and organized, we can create more secure, maintainable, and reusable code. Thank you for listening.

With love,
Jackie Chan's Grandmother
Рекомендации по теме
Комментарии
Автор

Comes from the video tutorial on how to build a life-changing app:

odddirector
Автор

Having to use Javascript is a horrible fate no one should endure.

munchlax
join shbcf.ru