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你是對的,我的壞。 –