Kasper Van Lombeek
Kasper Van Lombeek

Reputation: 633

Overlapping loading of jQuery scripts

For Highcharts, I have to load this Javascript:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

And for the autofill search box, I have to load this Javascript:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.min.js"></script>    

It seems that one cancels the other. Are these scripts conflicting and if so, how do I solve this?

Upvotes: 0

Views: 95

Answers (2)

David Hedlund
David Hedlund

Reputation: 129832

You're loading two versions of jQuery. The last one loaded will overwrite the value of jQuery and any plugins that may have been added to the previous jQuery object.

Chances are your plugins will work on more than that one specific version, though. If Highcharts will work with 1.9.1 you can remove the reference to 1.8.2 altogether, although you should make sure that 1.9.1 is loaded before you load the Highcharts plugin.

Upvotes: 2

Mat&#237;as Fidemraizer
Mat&#237;as Fidemraizer

Reputation: 64943

You'll need to load one jQuery version or other, but don't load it twice.

Highcharts may expect jQuery 1.8.2 or newer, while jQuery UI 1.10.1 expects jQuery 1.9.1 or newer.

Just add the newest jQuery version and check if both Highcharts and jQuery work as expected.

Upvotes: 2

Related Questions