我试图让重定向,并通过#参数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