我$('#form').serialize() = ""
在我的 ajax 调用之后得到:
$('#continueBtn').bind('click', function () {
var url = $('#form').attr('action') + setFlowEvent('continue');
$.ajax({
type : "POST",
url : url,
cache:false,
data: $('#form').serialize(),
dataType: "html",
success : function(response) {
var newContent = $($.parseHTML(response)).find("#ajax-content");
$('#ajax-content').html(newContent);
bindAjaxSubmit();
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert("error!");
}
});
});
我有下一个jsp代码:
<div id="ajax-content">
<form:form id="form" modelAttribute="model" action="${actionURL}" method="post">
<input id="field1" type="text" value="1" name="field1"></input>
<input id="field2" type="text" value="2" name="field2"></input>
<button id="continueBtn">continue</button>
</form:form>
</div>