Jquery serializeArray()序列化集合

xiaoxiao2025-04-30  13

form提交禁用序列化属性为集合,希望有回调并且能很好的后续处理 直接向后端传递参数即可

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script> </head> <body> <form id="test" onsubmit="return false;"> <input name="t1" value="1"/> <input name="t2" value="2"/> <input name="t3" value="3"/> <input type="submit" onclick="test()" value="提交"/> </form> <script type="text/javascript"> function test(){ console.log($("#test").serializeArray()); } </script> </body> </html>

f

转载请注明原文地址: https://www.6miu.com/read-5029519.html

最新回复(0)