jquery ajax beforeSend 提交等待问题
2015-09-14 14:12
501 查看
需要使用异步加载async : true 否则不会出现等待效果
$.ajax({
url : $('#form').attr("action"),
data: $('#form').serialize(),
cache : false,//true使用缓存 。 false不使用缓存
async : true,//true异步加载。 false同步加载
type : "POST",
dataType : 'text',//json/xml/html
success : function (obj){
if(obj > 0){
alert("发送成功");
}else{
alert("发送失败");
}
},beforeSend: function(){
showDialog("loading", "正在读取数据...");
}
});
$.ajax({
url : $('#form').attr("action"),
data: $('#form').serialize(),
cache : false,//true使用缓存 。 false不使用缓存
async : true,//true异步加载。 false同步加载
type : "POST",
dataType : 'text',//json/xml/html
success : function (obj){
if(obj > 0){
alert("发送成功");
}else{
alert("发送失败");
}
},beforeSend: function(){
showDialog("loading", "正在读取数据...");
}
});
相关文章推荐
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jquery 序列化整个表单作为参数传到后台
- jQuery.off() 函数详解
- Jquery 数组操作
- jQuery实现鼠标悬停背景翻转的黑色导航菜单代码