Window.Open如何在同一個(gè)標(biāo)簽頁(yè)打開(kāi)
更新時(shí)間:2014年06月20日 14:43:33 投稿:whsnow
這篇文章主要介紹了Window.Open如何在同一個(gè)標(biāo)簽頁(yè)打開(kāi),需要的朋友可以參考下
如果有Ajax,那么設(shè)置
async:false,//使AJax同步
var countdownInterval;
/*確認(rèn)立即充值*/
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;//設(shè)備SN碼
orderDetail[i].GPRSTel = deviceList[i].GPRSTel;//GPRS手機(jī)號(hào)碼
orderDetail[i].PayYear = parseInt($("#hdnYear").val());//年數(shù)
orderDetail[i].PayPotency = 100;//暫時(shí)默認(rèn)是兩百元
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);
//啟動(dòng)一個(gè)輪詢(xún),不斷去讀取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 打開(kāi)新窗口*/
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);
}
相關(guān)文章
關(guān)于JS中的apply,call,bind的深入解析
下面小編就為大家?guī)?lái)一篇關(guān)于JS中的apply,call,bind的深入解析。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-04-04
詳解微信小程序?qū)崿F(xiàn)跑馬燈效果(附完整代碼)
這篇文章主要介紹了微信小程序跑馬燈效果,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-04-04
javascript中日期函數(shù)new Date()的瀏覽器兼容性問(wèn)題
這篇文章主要介紹了javascript中日期函數(shù)new Date()的瀏覽器兼容性問(wèn)題,需要的朋友可以參考下2015-09-09
javascript 在firebug調(diào)試時(shí)用console.log的方法
當(dāng)你使用console.log()函數(shù)時(shí),下面的firebug一定要打開(kāi),不然這函數(shù)在用firefox運(yùn)行時(shí)無(wú)效且影響正常程序,如果用IE打開(kāi),將會(huì)出錯(cuò)2012-05-05
JS實(shí)現(xiàn)獲取漢字首字母拼音、全拼音及混拼音的方法
這篇文章主要介紹了JS實(shí)現(xiàn)獲取漢字首字母拼音、全拼音及混拼音的方法,涉及針對(duì)ChinesePY.js插件的使用及事件響應(yīng)相關(guān)操作技巧,需要的朋友可以參考下2017-11-11
input框中自動(dòng)展示當(dāng)前日期yyyy/mm/dd的實(shí)現(xiàn)方法
下面小編就為大家?guī)?lái)一篇input框中自動(dòng)展示當(dāng)前日期yyyy/mm/dd的實(shí)現(xiàn)方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-07-07

