Reputation: 4828
In css you can import a stylesheet in another stylesheet. How do you do this for javascript files? most specialy jquery plugins?
I searched first and found different similar questions but I'm not sure about the answer provided. (http://stackoverflow.com/questions/1618351/loading-js-files-dynamically-via-another-js-file)
I'm just looking for a way to limit http requests.
Upvotes: 0
Views: 98
Reputation: 4681
You can look at google's javascript compiler, closure.
I've been using it in my Rails projects for some time now, through a tool called Jammit, and it does do wonders compressing JS to ridiculous sizes.
Upvotes: 1
Reputation: 630429
You can just append them one after another in a single file, or better, minify them alltogether, with either the YUI Compressor or Google Closure compiler....both will combine all files passed in and minify them as well. Then, you just serve that one file to your users that contains all your file you want to combine.
Upvotes: 1