我試圖讓重定向,並通過#參數JavaScript重定向與.hash
// I'm at: http://example.com/index.html
var url = 'http://example.com/category.html';
var hash = '#testsite';
// Ignores # and all after
window.location.href = url + hash;
// Does not work, sets hash first, then redirects to url without maintaining hash
window.location.href = url;
window.location.hash = hash;
是否可以像使用javasript重定向window.location.url?
你檢查我的答案?如果它是正確的,請接受它。謝謝! – Dekel