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>');
}
});
});
$('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>');
}
});
});
相关文章推荐
- 友盟推送 .NET (C#) 服务端 SDK rest api 调用库
- Shell上传文件到ftp
- 关于75条逻辑思维题
- SAT数学考题知识范围一览
- python django web项目的构建步骤(二)
- Linux常用命令详解
- 论“结婚生孩子要趁早”,否则真正的是“上有老下小”
- The Sherman-Morrison and Related Formulas
- (转)30 IMP-00019: row rejected due to ORACLE error 12899
- GeoServer 编辑
- Android UI自动化测试最佳实践
- Linux网络配置
- Decimal模块:小数的处理
- 数据块
- 线程同步异步实例分析
- 第三章第四十五题
- 浅谈HASH算法与CSDN密码泄漏事件
- STL --> set用法
- 查看线程死锁
- 从零开始学习制作H5应用——V5.0:后悔机制,整理目录,压缩,模板化