Using jQuery Address without jquery-migrate

767 Views Asked by At

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.

2

There are 2 best solutions below

0
trincot On BEST ANSWER

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.

0
Jaime Montoya On

The solution came from the comment trincot wrote to the question. I always thought that jQuery Address 1.5 was the latest version available because that is what they have at http://www.asual.com/jquery/address/. 1.5 appears as the only version available to download, and I cannot find version 1.6 anywhere. Why do they have version 1.6 only at https://github.com/asual/jquery-address and https://cdnjs.com/libraries/jquery.address, but not in the official page of the plugin at http://www.asual.com/jquery/address/? Or maybe http://www.asual.com/jquery/address/ is not the official page of the plugin?

I am going to mark this question as solved because by using jQuery Address 1.6, I do not need jquery-migrate-1.4.1.js anymore, so the question is already answered satisfactorily. However, I still think that jQuery 1.6 should have been available from http://www.asual.com/jquery/address/ to avoid confusion, or remove that link and redirect to the official website of the plugin, in case http://www.asual.com/jquery/address/ is not the official website.