Search code examples
jqueryfancybox

What is the difference between jquery.fancybox.js and jquery.fancybox.pack.js?


I'm designing a new website and I'm using Fancybox in it, I just got confused at a point: there are 2 JS files, jquery.fancybox.js and jquery.fancybox.pack.js, and whichever I use, the Fancybox works. I want to know what is the difference between them and which one is better to use? I'm not a JS expert so excuse my question.


Solution

  • The .pack version has been 'packed'. This means the code has been put through an algorithm which reduces it's size so that it is smaller and will take less time for visitors to your website to download, and cost you less in bandwidth.

    In a production environment you should always use packed javascript.

    In a development environment it is helpful to see the source behind whatever 3rd party plugin you're using, this is why there is two versions of the code.

    For more information on packing, read this. To pack your own code, use this online packing tool.