0

I know that this topic was already opened, but I think I have a different situation.

I need to do something like here:

link

and that toggle function works like that only with jQuery 1.8.3 / 1.7.2 / 1.6.4 / 1.4.4, and I use 1.9.1, in which it doesn't work like that.

I am wondering if you can use multiple versions of jQuery on a single web page. Actually, I need one of those older versions of jQuery (1.8.3 / 1.7.2 / 1.6.4 / 1.4.4), just for

toggle()

method. Let's say 1.8.3.

I found something here and I wan't to know if it's right:

<!-- load jQuery 1.8.3 -->
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.js"></script>
  <script type="text/javascript">
  var jQuery_1_8_3 = $.noConflict(true);
</script>

Here I have another question: I have to do the same thing for version 1.9.1? Because i will use just

jQuery_1_8_3('#selector').toggle();

The following code is required?

<!-- load jQuery 1.9.1 -->
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script type="text/javascript">
  var jQuery_1_9_1 = $.noConflict(true);
</script>

If it is, I will have to change all 1.9.1 function's selectors with

jQuery_1_9_1('#selector').function();
Community
  • 1
  • 1
Colin
  • 19
  • 1
  • 7

1 Answers1

1

You can use the jQuery Migrate Plugin to resolve your issue over here.

Using the plugin is easy, just include it immediately after the script tag for jQuery, for example.

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

For more information, see the jQuery Migrate documentation.

FIDDLE DEMO (Using the v1.9.1 & the migrate plugin)

palaѕн
  • 72,112
  • 17
  • 116
  • 136
  • Can you show me how to restore the functionality of toggle from older versions with this jQuery Migrate Plugin? I loaded the script: What I have to do now? – Colin Jun 20 '13 at 09:22
  • You don't need to do anything special. Just call your function like `('#selector').toggle();`. That's it. – palaѕн Jun 20 '13 at 09:24