I'm really stumped on this one. I'm trying to upgrade our jQuery version (using jQuery-migrate-3.0.0.js) and getting the error "JQMIGRATE: jQuery.unique is deprecated, use jQuery.uniqueSort" on the following code (seems to be on the return $('body').attr('data-token'):
(function ($) {
aSite.getAntiForgeryToken = function () {
return $('body').attr('data-token');
};
var antiForgeryToken = aSite.getAntiForgeryToken();
$(document).on('ajaxSend', function (e, xhr, options) {
try {
if (!options.crossDomain && antiForgeryToken) {
xhr.setRequestHeader('X-CSRF-Token', antiForgeryToken);
}
}
catch (ex) {
console.log('an error occurred attaching the token to the request', ex);
}
});
})(jQuery);
I don't see how this involves jQuery.Unique() at all. I've tried a ton of fixes for this (all from this site!) but I can't seem to get past this function.
Thanks for any help you can provide
Addition: the error message in more detail:
11:18:11.945 JQMIGRATE: jQuery.unique is deprecated, use jQuery.uniqueSort jquery-migrate-3.0.0.js:62:12
11:18:11.947 console.trace() jquery-migrate-3.0.0.js:64:13
jQuery 6
migrateWarn
get
find
init
init
jQuery
getAntiForgeryToken https://localhost/ASBUILD/js/shared/aSite.js:1932
<anonymous> https://localhost/ASBUILD/js/shared/aSite.js:1935
<anonymous> https://localhost/ASBUILD/js/shared/aSite.js:1947