2

my template is designed with JQ 1.6.2,now when i am using the path for 1.9.1 in header along with 1.6.2, obviously function of 1.9.1 is not working, while on removing 1.6.2 template getting destroyed... what the solution of it keeping the functionality of both (1.6.2 & 1.9.1) alive.

Zach Leighton
  • 1,939
  • 14
  • 24
user2325244
  • 55
  • 2
  • 8
  • 1
    [jQuery.noConflict()](http://api.jquery.com/jQuery.noConflict/) – Antony May 30 '13 at 10:31
  • 4
    Use [jquery migrate plugin](http://jquery.com/upgrade-guide/1.9/#jquery-migrate-plugin) – palaѕн May 30 '13 at 10:32
  • 2
    Use one or the other. Do not use both. It shouldn't be too difficult to upgrade to 1.9.1, and you'll have the benefit of using (presumably) better code. – Derek Henderson May 30 '13 at 10:33
  • I answered a similar (but more generic) question, here: http://stackoverflow.com/a/15507363/357774 – Noyo Feb 17 '14 at 10:43

3 Answers3

2

Palash had the answer http://jquery.com/upgrade-guide/1.9/ jQuery Migrate should do it.

Zach Leighton
  • 1,939
  • 14
  • 24
  • Migrate is not possible in this case I think: `It can be used for its diagnostics with versions of jQuery core all the way back to 1.6.4.` or upgrade 1.6.2 to 1.6.4 :) – JP Hellemons May 30 '13 at 10:40
2

Before one month, I also felt in same issue. I googled alot but atlast I have added jquery-migrate file, most of the problem get solved.

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>

Use this snippet of code, may this will resolve your issue.

Rubyist
  • 6,486
  • 10
  • 51
  • 86
0

http://forum.jquery.com/topic/multiple-versions-of-jquery-on-the-same-page

<script src='jquery-1.6.2.js'></script>
<script>
    var jq162 = jQuery.noConflict();
</script>
<script src='jquery-1.9.1.js'></script>
<script>
    var jq191 = jQuery.noConflict();
</script>

Don't forget to update the rest of your jquery/javascript code to take the right version of jquery.

I agree by the way with Derek, upgrading your template to use 1.9.1 is the best solution. But if you insist using 1.6.x then use the code sample from above.

Some sample code:

<script>
    jq191("body").css("color","red");
    jq162("#table").applyTemplate();
</script>
JP Hellemons
  • 5,977
  • 11
  • 63
  • 128
  • the same way i am using the no conflict..as suggested but still not finding my scripts to run properly – user2325244 May 30 '13 at 11:14
  • Then there is an error in the rest of your script. post that please – JP Hellemons May 30 '13 at 12:02