I want to organize/structure/encapsulate all my jquery javascript code:
I have a file "mypage_version1.js" with the following content (VERSION 1):
How can I organize it better?
Does the file "mypage_version2.js" with the following content (VERSION 2) structures the code better than "VERSION 1"?:
I am in doubt, which version is better (both works).
Version 1 is shorter, but cluttered within the file.
What is best practice?