zoukankan      html  css  js  c++  java
  • 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 () {

            }
        };

  • 相关阅读:
    面试题:JS中map的陷阱
    C#中正则表达式进行忽略大小写的字符串替换
    C#窗体钉在桌面、置底、嵌入桌面的办法
    创建C#串口通信程序详解
    为类和函数代码自动添加版权注释信息
    C# 如何编辑文件的摘要信息
    C# GDI在控件上绘图
    泛型Dictionary的用法详解
    Winform 导出成Excel打印代码
    C#反射深入学习
  • 原文地址:https://www.cnblogs.com/Denny_Yang/p/3360604.html
Copyright © 2011-2022 走看看