簡體   English   中英

強制IE中的鏈接在Firefox中打開

[英]Force a link in I.E. to open in Firefox

我在Sharepoint內置的公司Intranet站點中有兩個鏈接,需要鏈接到Firefox。 鏈接是指向無法在IE中運行的外部站點的。但是,公司瀏覽器是IE,因此大多數人都可以看到。

當我有一個鏈接時,我發現以下代碼有效。 如何使它適用於兩個鏈接?

這是代碼:

<!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>

您可以將腳本修改為:

<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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM