Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个<section id="thisitem"...>
<section id="thisitem"...>
当我尝试做window.navigate("#thisitem");JS 失败时……为什么?
window.navigate("#thisitem");
因为window.navigate()是特定于 IE 的,而不是跨浏览器兼容的。使用window.location.href = '#thisitem'.
window.navigate()
window.location.href = '#thisitem'
navigateDOM中没有方法window。
navigate
window
我想你的意思是:window.location='#thisitem';
window.location='#thisitem';