ajax发送到action自动解析格式

来源:互联网 发布:如何做淘宝美工 编辑:程序博客网 时间:2024/06/08 16:49

异步发送到action自动解析生成对象格式:

var id = $("#w2_id").val();var username = $("#w2_username").val();var password = $("#w2_password").val();var state = $("#w2_state").val();var cid = $("#w2_cid").val();$.ajax({url:'/CloudCourse/modifyUser',type:'post',dataType:'text',//注意data:{"cul.id":id,"cul.username":username,"cul.password":password,"cul.state":state,"cul.cid":cid},success:function(data){$("#w2").window("close");setTimeout(function(){$("#dg").datagrid("reload");},1000);},error:function(e){alert("发送请求失败!请检查网络!"+e);}});

在action中要声明private 对应变量使其为null,并且要有get 和set方法



原创粉丝点击