AJAX.JSONP 跨域

var Request = {
        timeout: 10 * 1000, // 10秒超时
        status: 10,
        statusenum: { Wait: 10, Pending: 20, Over: 0 },
        start: function () {
            UIResponse.start();
            var ordernum = rechargeQQ.getOrderNum();
            $.ajax({
                type: 'get',
                url: 'http://123.103.15.157:82/qbi/query',
                data: { num: ordernum, tsp: new Date().format("yyyyMMddhhmmss") },
                dataType: 'jsonp',
                jsonpCallback: 'Request.success'
            });
        },
        success: function (obj) {
            UIResponse.end();
            var query = {
                account: $("input[name=qq]").val(),
                productNo: $("#ProductNo").val()
            };
            query.num = rechargeQQ.getOrderNum();
            if (obj.result && obj.result == '100') {
                query.productNo = obj.product || $("#ProductNo").val();
                location.href = "/Sales/ConfirmRechargeQQ?" + jQuery.param(query);
            } else {
                alert(obj.msg || "Q币产品正在维护,暂时无法充值");
            }
        },
        timeout: function () {

}
    };

上一篇:Spring Cloud Alibaba基础教程:Nacos配置的多环境管理


下一篇:015_xml_函数