zoukankan      html  css  js  c++  java
  • ajax规范写法

    $.ajax({
        url: "http://1.1.1.1/api/v2/user/inviters", //接口
        type: "post", //GET或POST
        data: JSON.stringify({}), //数据
        headers: {
            'Content-Type': 'application/json'
        },
        //dataType: 'json',    //返回的数据格式:json/xml/html/script/jsonp/text
        success: function(msg) {
            if (msg.data && msg.data.inviters) {
                addFimg(msg.data.inviters);
            }
    
        }, //回调成功方法
        error: function(xhr, textStatus) {
            console.log(xhr);
            console.log(textStatus)
        }
    });
  • 相关阅读:
    第二阶段总结
    今日总结
    今日总结
    今日总结
    今日总结
    今日总结
    今日总结
    今日总结
    今日总结
    开学总结
  • 原文地址:https://www.cnblogs.com/phpfensi/p/7298561.html
Copyright © 2011-2022 走看看