Home Web Front-end JS Tutorial How to open Window.Open in the same tab_javascript skills

How to open Window.Open in the same tab_javascript skills

May 16, 2016 pm 04:43 PM
open window

If Ajax is available, set

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") 
} 
}); 
}
Copy after login
/*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); 
}
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What coin is OPEN? What coin is OPEN? Feb 21, 2024 pm 04:31 PM

What coin is OPEN? OPEN is an encrypted digital currency using blockchain technology, designed to provide support and services for open financial networks. The name OPEN not only represents its openness and transparency, but also attracts much attention in the blockchain industry. Features of OPEN OPEN uses blockchain technology to achieve decentralization, with no centralized institution or individual controlling its issuance and transactions. Anyone can freely participate in the trading and development of OPEN. OPEN's transaction records are publicly recorded on the blockchain. This transparency allows anyone to view and verify the authenticity of the transaction, thereby improving the security and credibility of the transaction. OPEN uses advanced blockchain technology to ensure rapid confirmation of transactions. In addition, OPEN’s transaction fees

Detailed graphic tutorial for installing Windows 10 tablet system Detailed graphic tutorial for installing Windows 10 tablet system Jul 14, 2023 am 09:33 AM

Tablet computers are currently very popular computers among many young people. Recently, many friends want to know how to install the Windows 10 tablet system, so today I will share with you a very simple one-click method to install Windows 10. Let’s take a look below! Detailed graphic tutorial for installing Windows 10 tablet system: 1. We search and download Xiaobai’s one-click reinstallation system software, choose to download and install the Win10 operating system, and click to install this system. 2. Wait for Xiaobai to download and deploy the environment. 3. After the deployment is completed, click Restart Now. 4. Choose to enter the Xiaobai pe system. 5. After entering the pe system, the installation tool will pop up to help us automatically reinstall the system. We do not need any operations.

How to open win10telnet How to open win10telnet Jan 06, 2024 pm 04:13 PM

When we go online, some users need to use the Telnet function but don't know how to operate it. This is usually turned off. If we want to use it, we need to enter the computer application to open it. How to open win10telnet 1. Enter "Control Panel" in the search bar in the lower left corner to open it. 2. Click "Programs and Features" here. 3. Click to enable the win function, then find "Telnet Client", and then click OK to open it. 4. Then press win+R, enter cmd5, and enter the Telnet command to test. If the following interface appears, it means it has been successful.

Windows 10 reinstall win7 system tutorial Windows 10 reinstall win7 system tutorial Jul 08, 2023 pm 05:45 PM

Many friends are not used to using the win10 system and want to reinstall the win7 system, but they don’t know how to start. The editor will teach you this simple method below. Friends who don’t know how to reinstall windows7 on the computer should not miss it. 1. First, we open the computer browser and search the official website of Magic Pig One-Click System Reinstallation, download it and open it. 2. After downloading, we open it and click online reinstallation. 3. Next, we will wait patiently for it to be installed. 4. The installation is complete. Next we need to click to restart the computer now. 5. After restarting the computer, we still need to return to the main interface to continue completing the installation. Then our installation is completed. The above are the steps for reinstalling the win7 system in windows 10. I hope it will be helpful to everyone.

How to implement vulnerability analysis of Disk Pulse Enterprise Window application How to implement vulnerability analysis of Disk Pulse Enterprise Window application May 18, 2023 pm 03:04 PM

1. Vulnerability Introduction DiskPulseEnterprise is a software that monitors disk changes. It can connect and manage the software through a management port 9120 or web management window 80 to monitor disk changes. There is a dynamic link library libspp.dll in DiskPulse Enterprise, which contains some functions responsible for HTTP operations. The problem occurs in this dynamic link library. When processing the post data, there is no strict length control on the post data, resulting in When executing the acquired data, it copies data to invalid memory, causing buffer overflow, triggering SEH abnormal behavior processing, and finally controlling EIP to execute arbitrary code. Software download link: h

How to solve Windows worm virus How to solve Windows worm virus May 17, 2023 pm 07:22 PM

0x00 Preface The worm is a very old computer virus. It is a self-contained program (or a set of programs) that usually spreads through the network. Every time it invades a new computer, it is on this computer. Makes a copy of itself and automatically executes its own program. Common worms: Panda Burning Incense Virus, Shock Wave/Shock Wave Virus, Conficker Virus, etc. 0x01 Emergency Scenario One morning, the administrator found at the egress firewall that the internal network server continued to initiate active connections to overseas IPs. The internal network environment was unable to connect to the external network, and there was no way to figure it out. 0x02 event analyzes the server's intranet IP seen on the egress firewall. First, disconnect the virus-infected host from the intranet, then log in to the server, open D-shield_web scan and check

How to modify the username and password of a shared computer in Windows 10 How to modify the username and password of a shared computer in Windows 10 Jul 21, 2023 am 11:05 AM

At work, we often use computer sharing functions. Recently, many friends have asked me how to change the username and password of a shared computer in Windows 10, so today I will share with you how to change the username and password of a shared computer in Windows 10. Nothing is more important than this, let's learn it together! How to modify the username and password of a shared computer in Windows 10: 1. Press the win key + r key, enter control and click OK. 2. Click on User Account. 3. Click Credential Manager. 4. Click Windows Credentials. 5. The certificate in the share is this certificate. Click Edit to make changes. The following is how to change the username and password of a shared computer in Windows 10.

Open a file using Python's open() function Open a file using Python's open() function Feb 19, 2024 pm 05:09 PM

Usage and code examples of the open function in Python. The open function in Python is a function used to open files. It can easily read and write files. In this article, we will introduce the usage of the open function in detail and give specific code examples. The basic syntax of the open function is as follows: open(file,mode='r',buffering=-1,encoding=None,errors=None,new

See all articles