How does RequireJS download a new script file? -


i'm trying wrap mind around requirejs. understand modularity provides , on-demand script loading.

my doubt was: how can script download script? wondering whether exists api allows custom javascript code call script download, or how other way requirejs use accomplish that. i've searched around answer without success.

i've found answer @ requirejs source code. i’ve found load function, if runtime environment browser, create <script> tag , put in <head> of document, appropriate url in src attribute. check createnode function also.

once tag created , added document, browser download script file.


Popular posts from this blog