[英]Force a link in I.E. to open in Firefox
I have two links in a corporate intranet site, built in Sharepoint, that I need to link to Firefox. 我在Sharepoint内置的公司Intranet站点中有两个链接,需要链接到Firefox。 The links are to an external site that does not work in IE However, the corporate browser is IE, so that's what most people see.
链接是指向无法在IE中运行的外部站点的。但是,公司浏览器是IE,因此大多数人都可以看到。
I found the below code that works when I have one link. 当我有一个链接时,我发现以下代码有效。 How do I get it to work for two links?
如何使它适用于两个链接?
Here's the code: 这是代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>HTA Test</title>
<hta:application applicationname="HTA Test" scroll="yes" singleinstance="yes">
<script type="text/javascript">
function openURL()
{
var shell = new ActiveXObject("WScript.Shell");
shell.run("http://www.google.com");
}
</script>
</head>
<body>
<input type="button" onclick="openURL()" value="Open Google">
</body>
</html>
You can modify your script to something like: 您可以将脚本修改为:
<script type="text/javascript">
function openURL(url)
{
var shell = new ActiveXObject("WScript.Shell");
shell.run(url);
}
</script>
</head>
<body>
<input type="button" onclick="openURL('http://www.google.com')" value="Open Google">
<input type="button" onclick="openURL('http://www.yahoo.com')" value="Open Yahoo">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.