window.open方法解析
2020-12-13 06:15
标签:des style blog http color 使用 os io window.open方法解析,搜素材,soscw.com window.open方法解析 标签:des style blog http color 使用 os io 原文地址:http://www.cnblogs.com/hellohuman/p/3901464.htmlvar cmbBankWin = window.open(‘https://pbsz.ebank.cmbchina.com/CmbBank_GenShell/UI/GenShellPC/Login/Login.aspx‘, ‘newhb‘, ‘menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes‘);
function isBlocked(){
var blocked = false;
try{
var cmbBankWin = window.open(‘https://pbsz.ebank.cmbchina.com/CmbBank_GenShell/UI/GenShellPC/Login/Login.aspx‘, ‘newhb‘, ‘menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes‘);
if(cmbBankWin == null){
blocked = true;
}
}catch(ex){
blocked = true;
}
return blocked;
}
function openNewWin (url) {
var r = document.documentElement;
var f = document.createElement("form");
f.target = "_blank";
f.method = "get";
setParams(url);
r.insertBefore(f, r.childNodes[0]);
f.action = url;
f.submit();
$(f).remove();
function setParams(url){
var paramsObj = $T.Url.getQueryObj(url);
var inputTemplate = ‘‘;
for(var name in paramsObj){
if(paramsObj.hasOwnProperty(name)){
$(f).append($TextUtils.format(inputTemplate, [name, paramsObj[name]]));
}
}
}
}
var newWin = window.open(‘about:blank‘); // 先弹出新窗口
var options = {};
options.success = function(url){
newWin.location.href = url; // AJAX返回地址后再改变新窗口的location.href属性
};
options.error = function(result){
console.log(result);
};
self.model.getUrl(options);// 异步获取URL地址