Christophe
Christophe

Reputation: 4828

how to group jQuery plugins together?

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

Answers (2)

changelog
changelog

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

Nick Craver
Nick Craver

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

Related Questions