jQuery的serialize()方法的作用。
jQuery官网的API:http://api.jquery.com/
或参照该例子的中文API:http://jquery.cuishifeng.cn/jQuery.post.html
例子:
$("#button").click(function() {
$.post("index.php", $("#myform").serialize(),
function(re) {
if (re.status == 1) {
alert('保存成功!');
window.parent.location.reload(true);
} else {
alert(re);
}
},
"json");
});
官网解释:
http://api.jquery.com/serialize/
发表评论 取消回复