Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating jQuery Version

Tags:

jquery

version

Just wondering if there's any tutorials or ways to update jQuery scripts and functions.

I have version 1.4 and version 1.6.2 running, and I want to update both of them to 1.7.1 but I need to modify my script. I have no clue where to begin and what to change. Where can I start?

like image 927
user1165861 Avatar asked Feb 05 '12 18:02

user1165861


2 Answers

The place to begin would be to read the release notes of each jQuery update.

Here's the link for 1.7 API changes. That page also includes a link to the change log.

Do this for each version you need, starting with the earliest. This will let you know not only of potential breaking changes, but also of new features that are available to you.

For the different versions, see the menu on the left from the first link I provided...

enter image description here


EDIT:

Since from the link provided in a comment, there seems to be an issue with a plugin, you'll want to check the sites of all your plugins to make sure that you're using the latest version.


Direct cause of the issue

It seems that the direct issue you're having is that you're loading jQuery more than once, and demolishing the basic-jquery-slider.js plugin with the second load.

<!--loading jQuery-->
<script src="../js/jquery-1.6.2.min.js"></script>

<!--loading the slider plugin-->
<script src="../js/basic-jquery-slider.js"></script>

<!--loading jQuery again, which is overwriting 
                      the original jQuery and its plugin-->
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>
<script type='text/javascript' src='../js/jquery.ba-hashchange.min.js'></script>
<script type='text/javascript' src='../js/dynamicpage.js'></script>

You should load only one version, and load it before any plugins are loaded.

like image 125
3 revsuser1106925 Avatar answered Nov 01 '22 21:11

3 revsuser1106925


Just update the library and test your site in all the browsers. There is no other way than testing cross browser functionalities.

After that you can think of using the latest changes jQuery has reelased may be for bug fixing or performance improvement. It depends on you whether to go for it or not based on the kind of application you have.

like image 34
ShankarSangoli Avatar answered Nov 01 '22 19:11

ShankarSangoli