Take help of Google to load jQuery
Google is hosting jQuery libraries for several years now and if you load jQuery from Google, you can enjoy two advantages. First of all, it saves your bandwidth because Google utilizes CDN. The second advantage is that there is a chance of the jQuery being cached in the user’s computer, if he has visited a site that transports jQuery from Google Code.
Merge your scripts
Reduce usage of DOM
If you want jQuery to perform faster, then you must reduce the number of times the code needs to enter into DOM. DOM is used for insertion tasks like .append, .prepend etc. In order to prevent your site from slowing down, you need to use string concatenation. The advantage of string concatenation process is that it builds the list and then uses a single function to add them.
Avoid classes, use ID
Let’s first clarify something. One of the biggest USPs of jQuery is that you can use both classes and IDs to select DOM elements. Both processes are very easy. However, it is wise to select the DOM elements by ID because jQuery uses web browser’s default method, which is “getElementByID” to do this.
Unleash animate function
Ask any veteran web developer why he likes jQuery and he will tell you that he likes the jQuery animation facilities. jQuery offers easy to use pre-determined animation functions such as fadeIn, slideDown etc. So, if the client asks you to build a dynamic website, you can use this pre-defined animation functions to make the site beautiful within a few minutes. Do you know that jQuery animations are automatically queued? So, if you want to run an animation twice, then just call the animation code twice.
Don’t just write jQuery codes because you can. You must have a clear idea of your purpose because a good web programmer does not take whimsical decisions. Think your code visually and discuss with your team members. Don’t try to reinvent something that has already been done by others.
If you want to know more about jQuery coding, then you should visit BigDropInc.com. You will get lot more information in this site.