views:

51

answers:

2

Hello,

What is the best way to minify jQuery with other js files. My goals is one request for all my JS files. I have about 6 other js files that I would like combine with jQuery and the jQuery UI. When I leave the jQuery library and UI library out of the minification file it is fine. So I have three requests:

  1. jQuery library
  2. jQuery UI
  3. minified remaining js files

I tried combining the 1&2 with 3 but jQuery always says it is undefined. I tried using both the minified and NON minified versions of jQuery.

I am using the php minify program from yahoo. Any suggestions?

Thanks, Brian

A: 

Make sure you combine them in the correct order. jQuery must be first.

David Radcliffe
Thank you for the suggestion. Too clarify I also tried that. I put jQuery first then the other files. Am I missing something simple? Has anyone done this before? I know I could load from Google's CDN but I prefer to put them all in one file.
digitalbart
Sorry I had the jQuery library first but the jQuery UI was called above that. I moved that below and it worked perfectly. I am going to try combining all three now with jQuery first, UI second and then the remaining. Thanks.
digitalbart
A: 

Try using Reducisaurus, as long as you define the files in the right order everything should work fine.

PS: Make sure you cache the Reducisaurus minification, sometimes it is too busy to serve your files.

Alix Axel