1

How can I hide the hash value from the following link href in the address bar?

<a href="index.php#dev_name">

So it'll redirect me to a the index.php#dev_name, but I want the address bar to only show index.php

4

1 回答 1

2

您可以使用 Javascript onclick 事件。浏览器仍然会显示index.php,但会先触发 onclick 事件,并将浏览器重定向到正确的页面。

<a href="index.php" onclick="location.redirect('index.php#dev');">
于 2012-04-06T15:07:13.017 回答