问题描述:

<a href="#" onClick="load_page()">intro</a>

I don't want to print # sign on URL, I wanted it to look like below :

www.mydomain.com/

But it looked like this

www.mydomain.com/#

Anyway to do this?

网友答案:

Change the URL to:

<a href="/" onClick="load_page(); return false;">intro</a>

?

网友答案:

One popular way is to assign href="javascript:void(0)" Another one is to prevent anchor default action via return false in click handler as jacouh answered. I would prefer the second way as more clean.

相关阅读:
Top