2013-05-17 75 views
5

我需要通過JavaScript代碼隱藏所有瀏覽器的地址欄。有可能嗎?在所有瀏覽器中隱藏地址欄

這裏是我的代碼:

window.open("displayPdf.php?mnth="+mnth+"&year="+year+"&val="+newVal); 
    dom.disable_window_open_feature.location 
    dom.disable_window_open_feature.resizable 
    dom.disable_window_open_feature.status 
+0

你想隱藏當前winodw的地址欄?或者你想彈出隱藏地址欄的另一個窗口? – Hariprasad

+0

我想隱藏彈出窗口地址欄............ –

+0

請參閱下面的答案 – Hariprasad

回答

16

這不再是可能的,由於安全限制的現代瀏覽器。

官方(-ish)來源:

  • Firefox

    在Firefox 3,現在dom.disable_window_open_feature.location默認爲true,迫使很像IE7的地址欄的存在。有關更多信息,請參閱錯誤337344。

  • Internet Explorer 7 and later

    在Internet Explorer 6,位置指定是否顯示地址欄。

    (暗示的行爲與IE6結束)

  • Chrome/Chromium

    這些工具欄隱藏參數在Chrome被忽略。 您還會注意到,現代瀏覽器正在朝着隱瞞它作爲安全/反釣魚措施的方向前進。 也看到https://bugzilla.mozilla.org/show_bug.cgi?id=337344

-4
ClientScript.RegisterStartupScript(GetType(), "openwindow", "<script type=text/javascript> window.open('abc.aspx?id=" + str_id + "','null','location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,addressbar=0,titlebar=no,directories=no,channelmode=no,status=no'); </script>"); 
+0

請編輯你的答案並設置代碼的格式以使其可讀 – kleopatra

相關問題