Pregunta

I will soon be tasked with upgrading to jQuery 1.9. That said I know a few places where we have live(); toggle(); hover(); and browser(); with a number of surprises on the way, -I'm sure.

If I add the migrate pluggin, will it continue to execute the old code -or just give me messages in the console to help me track down and fix things?

Has anyone made such a wide jump from 1.4.1 to 1.8 or 1.9? that has implemented the migrate pluggin and seen how well it works and the limitations?

¿Fue útil?

Solución

The oficial jQuery site describes it pretty well http://jquery.com/upgrade-guide/1.9/#jquery-migrate-plugin

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.

Otros consejos

jQuery Migrate Plugin works just fine as jQuery.

Any deprecated feature will display warnings on the browser's console (if using plugin's uncompressed version and for IE browsers use Firebug Lite for console). In most cases these messages are simply warnings; code should continue to work properly as long as the jQuery Migrate plugin is used, but it is recommended to change the code where possible to eliminate warnings so that the plugin does not need to be used.

To find entire list of warning messages see https://github.com/jquery/jquery-migrate/blob/master/warnings.md

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top