zoukankan      html  css  js  c++  java
  • jquery Ajax请求示例,jquery Ajax基本请求方法示例

    jquery Ajax请求示例,jquery Ajax基本请求方法示例

    ================================

    ©Copyright 蕃薯耀 2018年5月7日

    https://www.cnblogs.com/fanshuyao/

    Js代码  
    1. $.ajax({  
    2.     //async: false,//设置为同步,默认为异步(一般不需要)  
    3.     url : "xxx/xxx.html",  
    4.     type : "post",  
    5.     //dataType : "json",  
    6.     data : {  
    7.         "method" : "bb",  
    8.         "doc_no" : "aa"  
    9.     },  
    10.     complete : function(XMLHttpRequest, textStatus){  
    11.         //alert("textStatus="+textStatus);  
    12.         //closeLoading();//关闭进度条  
    13.     },  
    14.     error : function(XMLHttpRequest, textStatus, errorThrown){  
    15.         //closeLoading();//关闭进度条  
    16.         if("error" == textStatus){  
    17.             //$.messager.alert("系统提示", "服务器未响应,请稍候再试", "info");  
    18.         }else{  
    19.             //$.messager.alert("系统提示", "请求失败,textStatus="+textStatus, "info");  
    20.         }  
    21.      },  
    22.      success : function(data){  
    23.          if(data != null){  
    24.              if("success" == data.result){  
    25.                  //TODO  
    26.              }else{  
    27.                 // $.messager.alert("系统提示", "操作失败,请重试", "info");  
    28.              }  
    29.              //console.log("result = " + data.result + ",msg=" + data.msg);//IE不支持console输出  
    30.          }else{  
    31.              //$.messager.alert("系统提示","返回结果为空!","info");  
    32.          }  
    33.      }  
    34. });  

    ================================

    ©Copyright 蕃薯耀 2018年5月7日

    https://www.cnblogs.com/fanshuyao/

  • 相关阅读:
    python基本数据类型之整型和浮点型
    Java学习路线
    Linux学习笔记之VIM
    Java基础之流程控制
    Linux学习笔记之Shell
    Java基础之数据类型
    论文提交说明
    IDEA安装教程
    Link summary for writing papers
    1 类基础知识
  • 原文地址:https://www.cnblogs.com/fanshuyao/p/9023740.html
Copyright © 2011-2022 走看看