From 62e5c4411952d9c8b425e70464526c155a8dc361 Mon Sep 17 00:00:00 2001 From: jp41011 Date: Mon, 30 Jan 2023 15:40:57 -0800 Subject: [PATCH 1/3] Update warnings.md - jquery.fn.unload() I think that jquery.fn.unload() should have the "is deprecated and removed" label. .unload() was deprecated in jquery v1.8 and removed in v3.0 So if you get this "warning" it will not actually work once you remove the jquery migrate plugin. Reference: https://api.jquery.com/unload/ --- warnings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warnings.md b/warnings.md index e3773cfb..080331f6 100644 --- a/warnings.md +++ b/warnings.md @@ -61,7 +61,7 @@ This is _not_ a warning, but a console log message the plugin shows when it firs **Solution:** Change any use of `$().error(fn)` to `$().on("error", fn)`. ### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.load() is deprecated -### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.unload() is deprecated +### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.unload() is deprecated and removed **Cause:** The `.load()` and `.unload()` event methods attach a "load" and "unload" event, respectively, to an element. They were deprecated in 1.9 and removed in 3.0 to reduce confusion with the AJAX-related `.load()` method that loads HTML fragments and which has not been deprecated. Note that these two methods are used almost exclusively with a jQuery collection consisting of only the `window` element. Also note that attaching an "unload" or "beforeunload" event on a window via any means can impact performance on some browsers because it disables the document cache (bfcache). For that reason we strongly advise against it. From a82c9443bb41be3f73d61a8f9e2dd2f359ac1183 Mon Sep 17 00:00:00 2001 From: jp41011 Date: Wed, 5 Apr 2023 11:48:14 -0700 Subject: [PATCH 2/3] Updates warnings.md - jquery.fn.load([eventData], handler) Updates warning to make it more clear that jQuery.fn.load( [eventData], handler ) was deprecated and removed. This is different from the AJAX-related `.load()` method. We do mention the AJAX-related method in the **Cause:** section. --- warnings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warnings.md b/warnings.md index 080331f6..dc1e1ab9 100644 --- a/warnings.md +++ b/warnings.md @@ -60,7 +60,7 @@ This is _not_ a warning, but a console log message the plugin shows when it firs **Solution:** Change any use of `$().error(fn)` to `$().on("error", fn)`. -### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.load() is deprecated +### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.load( [eventData], handler ) is deprecated and removed ### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.unload() is deprecated and removed **Cause:** The `.load()` and `.unload()` event methods attach a "load" and "unload" event, respectively, to an element. They were deprecated in 1.9 and removed in 3.0 to reduce confusion with the AJAX-related `.load()` method that loads HTML fragments and which has not been deprecated. Note that these two methods are used almost exclusively with a jQuery collection consisting of only the `window` element. Also note that attaching an "unload" or "beforeunload" event on a window via any means can impact performance on some browsers because it disables the document cache (bfcache). For that reason we strongly advise against it. From b4f2937591803152554795e371261f7f9cf6ee1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Wed, 5 Apr 2023 23:00:37 +0200 Subject: [PATCH 3/3] Update warnings.md --- warnings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warnings.md b/warnings.md index dc1e1ab9..8817853a 100644 --- a/warnings.md +++ b/warnings.md @@ -60,7 +60,7 @@ This is _not_ a warning, but a console log message the plugin shows when it firs **Solution:** Change any use of `$().error(fn)` to `$().on("error", fn)`. -### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.load( [eventData], handler ) is deprecated and removed +### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.load( [ eventData ], handler ) is deprecated and removed ### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.unload() is deprecated and removed **Cause:** The `.load()` and `.unload()` event methods attach a "load" and "unload" event, respectively, to an element. They were deprecated in 1.9 and removed in 3.0 to reduce confusion with the AJAX-related `.load()` method that loads HTML fragments and which has not been deprecated. Note that these two methods are used almost exclusively with a jQuery collection consisting of only the `window` element. Also note that attaching an "unload" or "beforeunload" event on a window via any means can impact performance on some browsers because it disables the document cache (bfcache). For that reason we strongly advise against it.