Search code examples
jqueryjquery-addressjquery-migrate

Using jQuery Address without jquery-migrate


I upgraded jQuery from 1.3.1 to 3.2.1. In the process, I used jquery-migrate-1.4.1.js. When I remove jquery-migrate-1.4.1.js, the page stops working properly until I also remove jquery.address-1.5.min.js. The only reason why I need jquery-migrate-1.4.1.js is because jquery.address-1.5.min.js uses deprecated code. Otherwise, I would be able to get rid of jquery-migrate-1.4.1.js because all of my code and plugins are now compatible with jQuery 3.2.1. I was reading https://github.com/asual/jquery-address/issues/159 and the reported issue is that "after upgrading to jQuery 1.9, jQuery Address stops working". This person reports that things work again when using jquery-migrate but with some warnings:

JQMIGRATE: jQuery.browser is deprecated jquery-migrate-1.0.0.js:29
JQMIGRATE: AJAX events should be attached to document: ajaxComplete jquery-migrate-1.0.0.js:29
JQMIGRATE: jQuery.fn.live() is deprecated jquery-migrate-1.0.0.js:29

I am using jquery.address-1.5.min.js, which is the latest version available at http://www.asual.com/jquery/address/, and it is still not compatible with jQuery 3.2.1. It requires jquery-migrate-1.4.1.js in my case, because jquery.address-1.5.min.js contains deprecated jQuery code.

How can I use jQuery Address without jquery-migrate? I guess I would have to modify the original jquery.address-1.5.min.js and replace the legacy code with modern jQuery equivalents. Too bad that jquery.address-1.5.min.js does not offer a newer version. jQuery Address Plugin v1.5 is from 2012-08-17 16:32:52 -0700 (Fri, 17 Aug 2012). Thanks.


Solution

  • According to the project info on github the latest version is 1.6, which adds "Support for jQuery 1.9". So it should solve the problem you quoted from issue 159 which was particularly related to compatibility problems with jQuery 1.9

    I see you can access jQuery Address version 1.6 also from cdnjs.com.