Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery override older version of jQuery

We have reference to jQuery 1.3.2 in the head of a page which we can't change, and further down the page it calls jQuery 1.5.1.

Will it just override itself in the code further down or can there be potential conflicts?

like image 648
fire Avatar asked Mar 22 '11 11:03

fire


1 Answers

You will probably need to use the noConflict command:

http://api.jquery.com/jQuery.noConflict/

If you aren't actually using the older version at all I would put this at the top directly after it is loaded (but before you load 1.5.1):

<script type="text/javascript">
    $.noConflict(true); // <-- true removes the reference to jQuery aswell.
</script>
like image 91
Richard Dalton Avatar answered Sep 28 '22 16:09

Richard Dalton