1
我目前在一個網址像這個 -使用Javascript - 頁面重載不與散列值工作
我要重新加載這個頁面JS/jQuery,這樣我可以有我確切的URL與散列。
所以我做了什麼是 -
路1
location.reload();
路2 -
location.reload(true);
方式3-
window.location.replace(window.location.href);
路4-
window.location.href += window.location.hash;
location.reload(window.location.href);
但沒有任何工作。每天的這個4路是給我一個重定向到
但我想重定向URL - http://localhost:8000/settings#social_accounts
任何人都可以請幫助?
使用window.location.href,所以window.location.href = window.location.href –
這是奇數行爲' location.reload()'工作正常**如果瀏覽器首先請求URL爲has,而不是用歷史記錄API修改URL –
您是否擁有#social_accounts id的div? –