sgj
3 天以前 241d327e57cbfe504aa806c61aa22e6205706098
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
 * 微信公共工具类
 */
var wxCommon = {
    //从这里开始写方法
 
 
    /**
     * 通用POST请求(JSON格式)
     * @param {string} url - 请求地址
     * @param {Object} data - 请求数据
     * @param callback
     */
    postJson: function (url, data, callback) {
        $.ajax({
            type: "POST",
            url: url,
            dataType: "json",
            contentType: "application/json;charset=UTF-8",
            data: JSON.stringify(data),
            beforeSend: function () {
            },
            success: function (result) {
                if (typeof callback == "function") {
                    callback(result);
                }
            }
        });
    },
 
    //此行以后不写代码
};