2017-04-25 47 views
0

打開我有一個企業內部網站,內置在Sharepoint兩個環節,我需要鏈接到Firefox瀏覽器。這些鏈接指向在I.E.中不起作用的外部網站。然而,企業瀏覽器是I.E.,這是大多數人看到的。在I.E.強制鏈接在Firefox

我發現了下面的代碼,當我有一個鏈接時工作。我如何獲得它的兩個鏈接工作?

下面的代碼:

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

好像你會通過在鏈接....我很驚訝CORP規則唐;禁用了ActiveX。 – epascarello

回答

1

您可以修改你的腳本是這樣的:

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