0
top.location.hash = "";
將#添加到我的地址欄中。只要top.location.hash = "";
被調用並且添加了一個#,我的瀏覽器窗口就會跳轉到頂端。javascript top.location.hash =「」;沒有瀏覽器跳到頂部?
有沒有可能阻止這種情況?
$('#element').live('click', function() {
top.location.hash = "map";
});
在這種情況下,它可能有助於知道你想用** top.location.hash =''; ** – harpo 2011-03-21 21:29:36
實現什麼。我只是有一個#hashLikeThis已經在我的地址。當我點擊頁面上的特定元素時,我將#hash更改爲無,因此用戶不會感到困惑。更新了我的帖子! – matt 2011-03-21 21:33:37
如果瀏覽器重新加載頁面,你會關心嗎? – 2011-03-21 22:01:23