click() shorthand is deprecated at jQuery 3
@see https://github.com/jquery/jquery-migrate/blob/master/warnings.md#jqmigra...
The .on() and .trigger() methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3187940-4.patch | 29.8 KB | jrockowitz |
Comments
Comment #2
jrockowitz commentedComment #3
jrockowitz commentedHere are the replacement patterns
Trigger replacement pattern
Find:
\.(click|blur|focus|focusin|focusout|resize|scroll|dblclick|mousedown|mouseup|mousemove|mouseover|mouseout|mouseenter|mouseleave|change|select|submit|keydown|keypress|keyup\contextmenu)\(\)Replace:
.trigger\('$1'\)Handler replacement pattern
Find:
\.(click|blur|focus|focusin|focusout|resize|scroll|dblclick|mousedown|mouseup|mousemove|mouseover|mouseout|mouseenter|mouseleave|change|select|submit|keydown|keypress|keyup\contextmenu)\(Replace:
.on\('$1',Comment #4
jrockowitz commentedComment #5
jrockowitz commentedThe fact that the patch is pretty much only two find-n-replaces and there some JavaScript test coverage makes me comfortable committing it.
If anyone runs into issues, please reopen this ticket and we can revert the patch.