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

I am developing a new website and I am using Fancybox in it, I am just confused about one place: there are 2 JS files, jquery.fancybox.js and jquery.fancybox.pack.js, and depending on what I am using, 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.

+3


source to share


2 answers


The .pack version has been "packaged". This means the code has been ported through an algorithm that reduces its size so that it is smaller and takes less time to load visitors to your site and costs you less bandwidth.

In production, you should always use wrapped javascript.



In a development environment, it is helpful to see the source behind whatever third party plugin you are using, so there are two versions of the code.

For more information on packaging, read this . Use this tool to package your own code.

+4


source


... Batch version usually means that the library code has been minified with special compression that requires the code to be evaluated by the operatoreval()



Since using eval () is not recommended for many aspects (safety and performance), the best approach is to use minified

the library version instead (like jQuery for the production version). The minified code is usually obtained from the original version by removing all spaces, comments and replacing identifiers with short variable names

+2


source







All Articles