On-Demand Script Loading with JavaScript

In this screencast a script is dynamically loaded by user action (with click on a button) and without any external libraries:

Dynamic script loading is particularly useful for polyfills, which can be conditionally loaded depending on browser's capabilities.

See you at Single Page Applications (SPAs) -- the "no frameworks, no migrations" approach, at Munich Airport, Terminal 2 or webstandards.training (online).

Comments:

Thank you, nice use of promises.

If im not mistaken, most interesting part was that script loaded just once even after multiple button clicks.

Posted by Martin Novak on November 08, 2018 at 02:35 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments
License