$.ajax({\n\t\t\tcache: false,\n\t\t\ttype: "POST",//请求的方式\n\t\t\turl : "ajax.php?act=user_add",//请求的文件名\n\t\t\tdata : {pwd:add_pwd,user:add_user,appid:add_appid},\n\t\t\tdatatype : 'json',\n\t\t\tsuccess : function(data) {\n\t\t\t\tconsole.log(data);\n\t\t\t\tdocument.getElementById('add_submit').disabled=false;\n\t\t\t\tdocument.getElementById('add_submit').innerHTML="确认添加";\n\t\t\t\tif(data.code == 200){\n\t\t\t\t\tt.NotificationApp.send("成功",data.msg,"top-center","rgba(0,0,0,0.2)","success")\n\t\t\t\t\twindow.setTimeout("window.location='" + window.location.href + "'",1000);\n\t\t\t\t}else{\n\t\t\t\t\tt.NotificationApp.send("失败",data.msg,"top-center","rgba(0,0,0,0.2)","error")\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn false;//重要语句:如果是像a链接那种有href属性注册的点击事件,可以阻止它跳转。\n\t\t});

使用Ajax进行POST请求添加用户