Taking file1.js and file2.js and combined them together to make file3.js


Using things like JsMin or YUICompressor


URL has /scripts/file2.js?v=123456


I use the JavaScript Compressorator. See my blog post which explains why I like it.

EDIT: I work primarily in SharePoint Designer, so my methods may not match yours. I'm more likely to do this to add my scripts to pages, whether the master page, page layouts, or individual aspx pages.

Yes, I would always use the minified versions in a "production" environment (where I didn't want to do any debugging).

The ?v= thing is sometimes required if you have overzealous caching going on in your environment. If you use unique names for your script files, then it's probably not necessary.

  • There are lots of compressors out there. Just wondering what technique you use to include it in SharePoint solutions. Do you manually include the min versions or do you have it going as a build action? – Shane Aug 23 '11 at 0:57
  • Shane: I added some edits above to explain my approaches more fully. – Marc D Anderson Aug 24 '11 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.