【发布时间】:2021-11-18 06:12:35
【问题描述】:
<!DOCTYPE html">
<html lang="en">
<head>
<meta charset="utf-8">
<title> Redirecting EWS Manager to Chrome </title>
<h1>Browser Redirecting ......</h1>
<script type="text/javascript">
{ varshell = new AciveXObject("WScript.Shell");
shell.run("Chrome //new Link here//");
window.location.replace("#old link the default browser"):}
setTimeot("pageRedirect()",3000);
</script>
</head?
</html>
以上代码用于重定向并命名为redirect.html。但它仅在我在 IE 中打开我的网站时才有效,以便它重定向到 Chrome。但如果我在 Chrome 中打开,它只会显示 Redirecting to Chrome。它在 Chrome 中不起作用,它只在 IE 中起作用。在 IE 中打开并重定向到 Chrome 是可行的。但是在 Chrome 中重新打开不起作用。我可以知道为什么吗?你能告诉我一个解决方法吗?
echo " <tr><td class=\"left_padding\"><a class=info href=\"http://sgewsweb.amk.st.com:8080/web/system/usermgr7/redirect_edge.html\" >User Manager<span>EWS Administrator</span></a></td></tr>";
此链接来自我的默认主页。当我单击选项卡时,它会在 Chrome 中打开。有人说我必须使用 onclick 功能,但我不知道如何使用它。你能帮我修一下吗?
enter image description here 当我打开 Chrome 时,它是这样的。
【问题讨论】:
-
"只有在我打开时才有效..." 只有,并且只有当你在IE中打开一个网站时,其他人已经保护了他们的机器通过不允许 ActiveX 执行。见stackoverflow.com/questions/10070744/…
-
是不是因为我使用了ActiveXObject>?
-
是的,允许任意网页执行 ActiveX 有潜在的危险。
-
那么,如何通过使用 IE 重定向到其他浏览器
-
您不能,让您的用户决定他们使用哪种浏览器,并创建与所有浏览器兼容的网页。并且放弃对 IE 的支持,即使它的供应商多年前就已经放弃了它。另外,你怎么知道用户是否在他们的机器上安装了特定的浏览器?
标签: javascript php html