2

I am trying to use a jQuery plugin on my site which uses jQuery 1.6.2. When I change the jQuery version to 1.9 the plugin no longer works. I thought there was a backwards compatibility feature in jQuery. Is there any way to know/fix the code that does not work in 1.9? If it helps I am trying to use a plugin called CropZoom and here is the link. Also, let me know if there is similar plugin the same features. I'll appreciate it. Thanks

8
  • Any console errors, or ideas?
    – danronmoon
    Commented Jan 30, 2013 at 1:19
  • 1
    Here is a link to the jQuery Migrate Information
    – ROY Finley
    Commented Jan 30, 2013 at 1:19
  • When I change the jQuery version to 1.9 it says "Uncaught TypeError: Cannot read property 'msie' of undefined "
    – RisingSun
    Commented Jan 30, 2013 at 1:21
  • 1
    jQuery.browser has been removed in 1.9. You're going to have to download jQuery migrate plugin.
    – danronmoon
    Commented Jan 30, 2013 at 1:23
  • I was reading the docs of the migrate plugin at it says "The plugin can be included with versions of jQuery as old as 1.6.4 as a migration tool to identify potential upgrade issues." Will that be an issue? My version is 1.6.2
    – RisingSun
    Commented Jan 30, 2013 at 1:25

2 Answers 2

6

This is How jQuery tell's you to fix it:

We realize that existing sites and plugins may be affected by these changes, and are providing the jQuery Migrate plugin for a transitional upgrade path. Individual descriptions below indicate if the behavior changed in 1.9 can be restored by using the jQuery Migrate plugin. Note that all of the changes in jQuery 1.9 will also apply to jQuery 2.0, and the jQuery Migrate plugin will be usable there as well.

The uncompressed development version of the jQuery Migrate plugin includes console log output to warn when specific deprecated and/or removed features are being used. This makes it valuable as a migration debugging tool for finding and remediating issues in existing jQuery code and plugins. It can be used for its diagnostics with versions of jQuery core all the way back to 1.6.4.

The compressed version of the plugin does not generate any log output, and can be used on production sites when jQuery 1.9 or higher is desired but older incompatible jQuery code or plugins must also be used. Ideally this would only be used as a short-term solution, but that's a decision for you to make.

LINK IS HERE

Other Options

  • Check with plugin developer to see if the plugin has been upgraded
  • find a newer version of a plugin with the same or close features
  • Update the plugin code yourself, by replacing depreciated code with relevant replacement code.
1
  • Thanks for the help. I really appreciate it. I tried out the plugin and it works perfect with 1.9. Right know I am replacing the old deprecated/removed codes. One thing the plugin does is checks if the browser is IE using browser.msie and if it is it uses a different css to transform an image than other browsers. I haven't found an easy way to do that check. In the meantime, I am checking if tbody is inserted automatically. Apparently IE does that.
    – RisingSun
    Commented Jan 30, 2013 at 2:41
2

when you are using jquery-1.9.1,jquery-migrate-1.1.1.min.js should be added for compatiability to previous versions as below

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

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