Deprecated jQuery “click” shorthand
-
Hi, with a jquery 3.7.1 and jquery-migrate 3.4.1 shipped on WordPress 6.4.2 a following error in the console appears:
jQuery.fn.click() event shorthand is deprecated migrateWarn @ jquery-migrate.js?ver=3.4.1:136 obj.<computed> @ jquery-migrate.js?ver=3.4.1:170 (anonymous) @ admin_bar_menu.js?np_v=1.10.4&ver=6.4.2:52 dispatch @ jquery.js?ver=3.7.1:5145 elemData.handle @ jquery.js?ver=3.7.1:4949 load (async) add @ jquery.js?ver=3.7.1:4997 (anonymous) @ jquery-migrate.js?ver=3.4.1:803 obj.<computed> @ jquery-migrate.js?ver=3.4.1:181 (anonymous) @ jquery.js?ver=3.7.1:4897 each @ jquery.js?ver=3.7.1:383 each @ jquery.js?ver=3.7.1:205 on @ jquery.js?ver=3.7.1:4896 on @ jquery.js?ver=3.7.1:5736 (anonymous) @ admin_bar_menu.js?np_v=1.10.4&ver=6.4.2:1
the error points to the admin_bar_menu.js file, which, in fact does use the deprecated shorthand
.click(function(){...})
. this can be fixed easily with rewriting the code to.on('click', function(){...})
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Deprecated jQuery “click” shorthand’ is closed to new replies.