第一种方式:
父页面
js 部分
var screenParam = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,top=0,left="+0+",height="+screen.availHeight+",width="+screen.availWidth;
var url = "http://"+window.location.host+"/Basis/apps/templates/Wfrm_test.html";
var win = window.open(url, "_blank", screenParam);
win.resizeTo(screen.availWidth, screen.availHeight);
html 部分
<form target="_blank"></form>
子页面
// 关闭上一级的页面
function closeWindow(){
if(window.opener){
try{
window.opener.open("","_self");
window.opener.opener = null;
window.opener.close();
}catch(e){}
}
}
第二种方式:
var command = "iexplore.exe http://" + window.location.host + "/"+systemName; // 拼接要跳转的页面路径
var objShell = new ActiveXObject("wscript.shell");
objShell.run(command);
objShell = null;
window.close(); // 关闭当前页面
第三种方式:
直接跳转到其他页面,不用关闭当前页面
// 跳转到其他页面
window.location.href = "apps/html/classManagement.html";
参考网址
https://blog.youkuaiyun.com/cherlshall/article/details/80938578