1

I'm going to study jQuery on prefessional level, I can write simple or advanced scripts and I have been using jQuery 1.7 version in which are functions and methods (like toggle();) which have been removed in latest versions (1.9, 1.10)..

now I'm using jQuery 1.10 and Sometimes I want to use old functions and methods, but they have been removed in 1.10... As I know, jQuery Migrate Plugin solves this problem..

Is it any problem, to use Migrate Plugin? or is it better to forget old functions and methods? I don't know what to do when I want to use old functions and methods..(for example: toggle();)

8
  • In the short term (if the code has to run now), use the Migrate plugin. In the mid-to-long term, upgrade your code to match the new version. When in doubt, research (e.g. there are several standalone implementations of toggle() available on Stack Overflow, and probably many others elsewhere). Commented Jul 28, 2013 at 11:52
  • 1
    They've been removed for a reason: no need to use them, there are better ways! Besides, why build new code on top of deprecated stuff?
    – frenchie
    Commented Jul 28, 2013 at 12:37
  • @frenchie: Perhaps he has to maintain an old project which now require the latest version of jQuery for some reasons or he has to create a new project but use old plugins that use the deprecated code. The migrate plugin is a short-term solution as said by Frédéric Hamidi, but of course it is better not to use it if it is posible.
    – glautrou
    Commented Jul 28, 2013 at 13:25
  • What do you mean: short-term solution? can you explain me ? @glautrou
    – Duke
    Commented Jul 28, 2013 at 15:10
  • When I say short-term it means if you create a new project and decide to use the migrate plugin with latest jQuery because of some libraries you are using this till your libraries are upgraded (soon I wish), and then you will have to remove the migration plugin and be fully compatible with latest jQuery. If you use a migration plugin that means you will have more code to maintain, new issues (more code = more issues), more script to load on all your pages, ... Sooner you leave the migration plugin is better. As it is named it is for migrations (intermediate step) not for long term.
    – glautrou
    Commented Jul 28, 2013 at 19:05

1 Answer 1

1

The migrate plugin can be useful for old applications but in the case of a new application it is much better to avoid using migration plugins. If tomorrow you upgrade your jQuery version you will have to deal with all your bunch of deprecated/removed code and continue using your migration plugin. However you may use the migration plugin in case you absolutely need to use another plugin not yet upgraded, but this is temporary.

3
  • OK,In counclusion is there any problem if I use jQuery 1.10 and migration plugin in my code??
    – Duke
    Commented Jul 28, 2013 at 12:55
  • No, you can use both.
    – glautrou
    Commented Jul 28, 2013 at 13:18
  • @Duki Did that answer to your original question?
    – glautrou
    Commented Aug 3, 2013 at 22:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.