Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depreciated jQuery reported by jQuery Migrate Plugin #216

Open
atwellpub opened this issue Jan 28, 2022 · 0 comments
Open

Depreciated jQuery reported by jQuery Migrate Plugin #216

atwellpub opened this issue Jan 28, 2022 · 0 comments

Comments

@atwellpub
Copy link

atwellpub commented Jan 28, 2022

From jQuery Migrate Plugin

https://wordpress.org/plugins/enable-jquery-migrate-helper/

jQuery.fn.unload() is deprecated | Plugin: o2 | https://****/wp-content/plugins/o2/modules/offline/js/offline.js

\'ready\' event is deprecated | Plugin: o2 | https://****/wp-content/plugins/o2/js/editor/editor.js

False Positives

wp-content/plugins/o2/modules/notifications/js/app/notifications.js leverages the event ready.o2, which jQuery Migrate Plugin picks up as a false positive.

Solution: ready event is depreciated

I'm following this article as a guide: https://api.jquery.com/ready/

wp-content/plugins/o2/js/editor/editor.js:84

replace

$doc.on( 'ready', function() {

with

$(function() {

Solution: unload is depreciated

I'm following this guide:
https://stackoverflow.com/questions/46443032/what-is-a-foolproof-alternative-to-window-unload/46443788

/wp-content/plugins/o2/modules/offline/js/offline.js:31

Change

jQuery( window ).unload( function() { o2.Offline.onWindowUnloading(); } );
To

jQuery( window ).on( 'beforeunload' , function() { o2.Offline.onWindowUnloading(); } );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant