ajax与php交互
ajax基本语法
$.ajax({
type: “post”, //数据提交方式(post/get)
url: “demo.php”, //提交到的url
data: {username:username,password:password},//提交的数据
dataType: “json”,//返回的数据类型格式
success: function(msg){
…//返回成功的回调函数
},
error:function(msg){
…//返回失败的回调函数
}
});
php端的接收方法
还没有评论,来说两句吧...