您的位置:首页 > 其它

ajax 的两种方式

2015-06-12 11:18 148 查看
1、

$('input').blur(function(){

$.ajax({

type: "GET",

url: "/10.php",

data: "1=a&2=b",

success: function(msg){

//alert( "Data Saved: " + msg );

}

});

})

2、

$('input').blur(function(){

//类型、URL、数据

$.get('25.php?u='+this.value , function(msg){

// alert(msg);

if(msg == '1') {

$('#reg').html('<font color="red">已被注册</font>');

} else {

$('#reg').html('<font color="green">可用</font>');

}

});

});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: