页面跳转相关方法

第一种方式:

父页面

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

 

转载于:https://www.cnblogs.com/7q4w1e/p/9894515.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值