As I'm moving into mobile Sweepstakes landers, I am currently learning more about Javascript, JS Libraries, JQuery, as much as I can - And I have a few questions I'd like to ask and hopefully someone can clarify for me:
I understand min.js is a minified js file, and I understand all the benefits (faster loading time, smaller file size, etc)
#1
So how come we must name it xxx.min.js when you minify? Isn't it just compressing the code using Javascript compressor and saving the compressed code in the original file xxx.js?
And is there any special procedure when you are converting a .js file to min.js file? From my understanding it is just compressing the code using Javascript compressor such as https://jscompress.com/ (Are there any better recommended compressors?)
Would just like to check if there's any speed or real difference when you compress the javascript code AND save it xxx.min.js?
#2
Also, I've read on several threads and many people recommend using Google Hosted Libraries to link to your lander
How do you know which Google Hosted Library to link to your lander? From my understanding, most sweepstakes landers (especially those win iPhone ones) are using JQuery - correct me if I'm wrong
I randomly ripped a lander from Adplexity

These are the files inside the ripped lander

And this is the JS file they have

In this case - is JQuery (or any of the Google Hosted Library) able to link up with this certain lander? So I can remove this ripped .js file and link straight to the Google Hosted ones?
Sorry if my info seems confusing - just trying to piece everything together in my mind
The min JS version does not only compress the file but also does NOT contain many function useful for development purposes but not for production.
Honestly, don't loose your time trying to gain page speed on that, any tiny image you will use on you landing will have 100X more impact on speed than a text file.
1. just naming the file "min" doesn't do anything. You can name the file whatever you want. The other benefits depend on how you do the minification and obfuscation
- minification saves you a few bytes but really helps on bigger Javascript files. If your code is 30 lines then the bandwidth savings are negligible
- obfuscation (when the minifyer renames the functions) makes it a little more difficult for people to reverse engineer your code and rip the stuff from you
2. To add google hosted jquery to your page - add the script tag from this page
https://developers.google.com/speed/libraries/#jquery