r/JavaScriptTips • • Feb 15 '23

Load other scripts from within a JavaScript file 📜

Post image
25 Upvotes

6 comments sorted by

1

u/caleb_dre Feb 15 '23

this seems extremely dangerous lol

2

u/Low_Mammoth_9371 Feb 15 '23

As it the case when running any JS in the browser, you should be mindful of the source.

1

u/KashN Feb 15 '23

Using Javascript to load Javascript. Very nice.

2

u/[deleted] Feb 16 '23

[removed] — view removed comment

1

u/Low_Mammoth_9371 Feb 16 '23

Beyond the obvious not setting your script tag to support modules, you don't need to install external packages this way befote importing them. One example would CDN links to libraries.