You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My site uses $.ajaxSettings.traditional = true, and we're working on upgrading to jQuery 3 now. The migrate script is showing a warning when I use $('form').serialize() because the implementation within jQuery uses param without checking the value of the traditional flag.
I was able to fix the warning by replacing $('form').serialize() with $.param( $('form').serializeArray() , $.ajaxSettings.traditional ), but I'm wondering for future users if it wouldn't be helpful to either:
Update the migrate documentation to suggest this fix (other programmers might have a hard time understanding what the problem is, since the migrate documentation doesn't reference serialize anywhere; I was confused for a bit before I realized that the offending code was within jQuery), or
modify the jQuery source to explicitly use the traditional flag in the serialize implementation:
My site uses
$.ajaxSettings.traditional = true
, and we're working on upgrading to jQuery 3 now. The migrate script is showing a warning when I use$('form').serialize()
because the implementation within jQuery usesparam
without checking the value of thetraditional
flag.(from
serialize.js
line 99-ish)I was able to fix the warning by replacing
$('form').serialize()
with$.param( $('form').serializeArray() , $.ajaxSettings.traditional )
, but I'm wondering for future users if it wouldn't be helpful to either:serialize
anywhere; I was confused for a bit before I realized that the offending code was within jQuery), ortraditional
flag in theserialize
implementation:Happy to PR if either of those is desirable.
The text was updated successfully, but these errors were encountered: