ILLEGAL Source Code?! | Javascript Dataset Tutorial and How to Encode/Decode HTML

preview_player
Показать описание

Is this source code ILLEGAL?!! Maybe in Missouri. In this tutorial, you will learn how and why we can use the Javascript dataset property to store data inside of an HTML element without displaying it in the browser. You will also learn how the Missouri Governor wanted to prosecute a reporter for viewing the HTML source code on a website.

🚀 This tutorial is part of a How To in Javascript tutorial playlist:

ILLEGAL Source Code?! | Javascript Dataset Tutorial and How to Encode/Decode HTML

(00:00) Intro
(00:09) Welcome
(00:16) The Backstory: Illegal Source Code in Missouri?!
(01:41) Why and how to store hidden data in HTML elements
(07:37) How to retrieve data from a dataset with Javascript
(10:42) Can we really "decode the HTML"?
(11:40) Creating a decode the HTML function
(15:17) An Easier Way: the he package

📺 Referenced Tutorials:

📚 References:

✅ Follow Me:

Was this tutorial about how and why to store data attributes in HTML and retrieve the data with Javascript helpful? If so, please share. Let me know your thoughts in the comments.

#javascript #dataset #html
Рекомендации по теме
Комментарии
Автор

Woohoo! Congratulation on 10k subscribers Dave. Keep going!

vasudev
Автор

Not surprising, this type of statement is expected from the guilty party, in such a case silence is appreciated.

anyways, I thought why not using innerHTML/textContent combination instead of using DOMParser,
so, I ran a few tests and the performance was very close, but finally I decided that DOMParser is better for one reason I found which is:
Inserting html using innerHTML (even to an in-memory created element), image tags if any will try to fetch their src content (not sure about other tags) and this is not the case for DOMParser

Thanks Dave,

ahmad-murery
Автор

I guess this is the problem when politicians try to legislate for technologies they don't understand!

caffeinated-pixels
Автор

Rumour has it the Stuxnet virus was developed in plain CSS

christian-schubert
Автор

You can’t see public information!! That’s hacking 🙄

AtomicCodeX