网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 Window.Open如何在同一个标签页打开
内容
    这篇文章主要介绍了Window.Open如何在同一个标签页打开,需要的朋友可以参考下。
    如果有Ajax,那么设置
    async:false,//使AJax同步
    var countdownInterval;
    /*确认立即充值*/
    function ToRecharge(){
    var paramData = new Object();
    paramData.PayType = 1;//支付宝支付
    paramData.OrderMoney = parseFloat($("#spShouldPay").text());//支付总金额
    var gprsTel = [];
    var orderDetail = new Array();
    for(var i = 0; i < deviceList.length; i++){
    orderDetail[i] = new Object();
    orderDetail[i].DeviceSN = deviceList[i].DeviceSN;//设备SN码
    orderDetail[i].GPRSTel = deviceList[i].GPRSTel;//GPRS手机号码
    orderDetail[i].PayYear = parseInt($("#hdnYear").val());//年数
    orderDetail[i].PayPotency = 100;//暂时默认是两百元
    gprsTel.push(deviceList[i].GPRSTel);
    }
    paramData.GPRSTel = gprsTel.join(",");
    paramData.OrderDetail = $.toJSON(orderDetail);
    paramData.rand = Math.random();
    paramData.PostType = "AddRecharge";
    $.ajax({
    url: '/App_Ajax/Service.ashx',
    data: paramData,
    type: 'post',
    async:false,//使AJax同步
    success: function(resultData){
    var jsonResult = $.parseJSON(resultData);
    if(!jsonResult.success){
    window.$.messager.alert('提示', "充值记录保存失败!");
    newwindow.close();
    return;
    }
    $("#backupdate").text("返回修改");
    $("#timerecharge").hide();
    $("#onrecharge").show();
    $("#rechargesuccess").hide();
    $("#hdnOrderStatus").val(jsonResult.obj.OrderStatus);
    $("#hdnOID").val(jsonResult.obj.OID);
    //启动一个轮询,不断去读取Recharge_Order表的OrderStatus如果成功那么就停止
    CheckOrderStatus(jsonResult.obj.OID);
    //window.open("http://www.baidu.com");
    openPostWindow(String.format("http://{0}/Default/Service/Recharge.aspx", location.host), $.toJSON(jsonResult.obj), "_blank")
    }
    });
    }/*POST 打开新窗口*/
    function openPostWindow(url, data, target) {
    var tempForm = document.createElement("form");
    tempForm.id = "tempForm1";
    tempForm.method = "post";
    tempForm.action = url;
    tempForm.target = target;
    var hideInput = document.createElement("input");
    hideInput.type="hidden";
    hideInput.name= "PostName"
    hideInput.value= data;
    tempForm.appendChild(hideInput);
    document.body.appendChild(tempForm);
    tempForm.submit();
    document.body.removeChild(tempForm);
    }
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/15 15:55:39