marcoslin / angularAMD

Facilitate use of RequireJS in AngularJS
http://marcoslin.github.io/angularAMD
MIT License
734 stars 171 forks source link

Remove scripts from DOM #150

Closed vaneshmali closed 9 years ago

vaneshmali commented 9 years ago

ReuireJS just adds a script tag to the page . In traditional Web page every refresh or navigation o browser loads only needed files and unloads (or caches) others files Suppose you have a web site with 10 links and each link needs a different JS file ; So if one user visits all the links the browser will load all 10 JS files just like you loaded them once ? And suppose the user machine and browser don't support the load of the 10 files at once and will crashe at the end a RequireJS (AMD) solution just delays the problem not solving it in my sens

marcoslin commented 9 years ago

I am not sure I understand your question but I will try to answer that I think you meant.

Yes, RequireJS basically add a script tag to the browser and which will cause the browser to load the JS file. The difference is that you can load it one at the time if you so desire, by invoking the dependency one link at a time. You can obviously have all 10 link loaded at once, but why would you use RequireJS in that case?

As for browser that won't support 10 files at once, I do not know of any modern browser that has that limitation. Such browser would certainly NOT support AngularJS.

Regardless, this question really belong in Stackoverflow or RequireJS's repo.