2009-12-02 57 views

回答

7

在Internet Explorer 7和更早版本有可能做到這一點使用

document.setHomePage("http://www.mywebsite.com/"); 

但是,這是不可能的較新版本(因爲它被認爲是一種安全性風險)和從未有可能在其他瀏覽器如Firefox。

最好的回退是實際指導用戶如何更改主頁而不是以編程方式嘗試完成它。

在Firefox中(我不確定其他瀏覽器),用戶可以拖動鏈接並將其放在主頁按鈕上,從而(在確認後)更改起始頁面。您可以通過指示用戶拖動圖像(位於鏈接到您的網站的錨標籤內)並將其放在主頁按鈕上來利用此功能。

2

這是不可能的。這將是一個安全風險。

0

你不能。自從IE7以來。

<!--[if IE]> 
Click on the "down" arrow just to the right of the "house" icon in 
your Internet Explorer toolbar and choose "Add or Change Home Page." 
Then click on "Use this webpage as your only home page" or 
"Add this webpage to your home page tabs," depending on 
your preference. 
<![endif]--> 
<![if !IE]> 
To make this page your home page, just drag the icon to the left of the 
URL in your location bar onto the "Home" icon in the "house" icon in 
your toolbar. Some browsers do this differently. You can always set your 
home page through the preferences of your browser. 
<![endif]> 
相關問題