我有一个像这样的网址../page/5/product
此页面有 ../page/5/product/10#anchor01 、 ../page/5/product/8#anchor01 等 anchor 。
页面加载后如何跳转到新页面显示的 anchor 。
希望有人能给我提示。
最佳答案
更改 location
对象的 hash
值将自动引导您到达 anchor 。
location.hash = "#anchor";
关于javascript - 页面加载时 - 如何转到页面 anchor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4803162/