jquery 跨域请求demo

$.ajax({
                  url    : url,
                  data   : {},
                  dataType : "jsonp",
                  jsonnp : "abc",
                  timeout:50,
                  success : function(map){
                   if(map["success"]=="true"){
                       alert("登录成功!",'登录成功');
                       location.reload();
                   }else{
                    alert(map["errorMsg"],'登录失败');
                   }
                  },
                  error:function (XMLHttpRequest, textStatus, errorThrown) {
                            // 通常 textStatus 和 errorThrown 之中
                            // 只有一个会包含信息
                            alert("请求超时,请稍后重试。"); // 调用本次AJAX请求时传递的options参数
                        }
             });

阅读全文
类别:Jquery 查看评论
posted @ 2011-05-09 18:21  周超亿  阅读(288)  评论(0编辑  收藏  举报