http://www.vaikan.com/docs/jquery.form.plugin/jquery.form.plugin.html#
1. Write a form in your page. A normal form, no special markup is required:
2. Introduce jQuery and Form Plugin Javascript script files and add a few simple codes to allow the page to initialize the form after the DOM is loaded:
// responseText是服务端的响应值。statusText是页面
// 提交状态值,success表示成功。
function callBackFunc(responseText, statusText) {
if (statusText == 'success') {
alert(responseText);
}
else{
alert(“服务端错误!”);
}
}
如果返回的是json数据则回调函数可以这么写
function resultFunction(responseText,statusText) {
if (statusText == 'success') {
if (responseText.code == 1) {
alert(responseText.message);
}
else {
alert('error occurs!');
}
}
else {
alert('服务器错误!');
}
}