1
我使用jQuery的serialize()
功能时,有一个问题:jQuery的序列化返回一个空字符串
<form role="form" id="enter-image-detail-form" method="post">
<div class="form-group">
<input type="text" class="form-control" id="image-name" placeholder="Enter image name" value="test">
</div>
<button type="submit" class="btn btn-default btn-success btn-block">Save</button>
</form>
$('body').on('submit', '#enter-image-detail-form', function(e){
console.log($(this).serialize());
e.preventDefault();
});
它返回一个空字符串。提前致谢。
@ T.J.Crowder你是对的,我的坏。 –