这是主要形式:
<div>
<form method="post" class="register" id="wiz-config">
<!-- HTML -->
<input type="radio" value="187" name="group-1" id="product-187" class="aselector" >
<input type="radio" value="188" name="group-1" id="product-188" class="aselector" >
<!-- HTML -->
<!-- Other ajax fields -->
</form>
</div>
其他ajax字段通过ajax加载。
问题是如果我使用
jQuery( document ).ready(function() {
var str = jQuery( "#wiz-config" ).serialize();
console.log(str);
});
它返回的是“空”。为什么?
最佳答案
你只是忘了输入 the selector # :
$( "#wiz-config" ).serialize();
关于javascript - 如何序列化包含 jQuery ajax 加载字段的表单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33943109/