我需要在jQuery/JavaScript的腳本,使特定網站作爲瀏覽器的主頁, 我需要它兼容所有瀏覽器,如果那可能。我需要在jquery腳本,使頁面作爲您的默認主頁網頁在瀏覽器
我不是說它應該自動完成,
謝謝。
我需要在jQuery/JavaScript的腳本,使特定網站作爲瀏覽器的主頁, 我需要它兼容所有瀏覽器,如果那可能。我需要在jquery腳本,使頁面作爲您的默認主頁網頁在瀏覽器
我不是說它應該自動完成,
謝謝。
在Internet Explorer 7和更早版本有可能做到這一點使用
document.setHomePage("http://www.mywebsite.com/");
但是,這是不可能的較新版本(因爲它被認爲是一種安全性風險)和從未有可能在其他瀏覽器如Firefox。
最好的回退是實際指導用戶如何更改主頁而不是以編程方式嘗試完成它。
在Firefox中(我不確定其他瀏覽器),用戶可以拖動鏈接並將其放在主頁按鈕上,從而(在確認後)更改起始頁面。您可以通過指示用戶拖動圖像(位於鏈接到您的網站的錨標籤內)並將其放在主頁按鈕上來利用此功能。
這是不可能的。這將是一個安全風險。
你不能。自從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]>
如果它是/是可能的,它通常是一個選項來禁用它。許多人這樣做是因爲它至少令人討厭,並且可能存在安全風險。 – cletus 2009-12-02 13:24:37