<href= "javascript:;" ></ a > < href= "#"></a>
These two kinds of wording. What is the difference between these two types of writing? What kind of writing is more standard?
href= "#" refers to the connection to the current page, in fact, is meaningless, the page will not be refreshed. This is a chain connection.
In the HTML language when making the page parameters, used to specify the URL of the link # # # #就是本页链接, href= "address" is linked to the address link to the default page, not pop-up window, empty connection, if you remove #, the mouse hand cursor is not displayed. The popular point is a false link to this page can also be followed by the # anchor ID This is actually another use of a bookmark.
Syntax: <a href= "#书签的名称" > linked text </a>
Bookmarks linked to different pages
Syntax: <a href= "link file address # bookmark name" > linked text </a> (note quotes and # numbers)
Under normal circumstances click: <a href= "#书签名称" > linked text </a> this link, the cursor will automatically jump to this page: <a name= "bookmark name" > Text </a> location.
If we just want to write a tag that doesn't have any event jumps happening. I personally do not recommend using <a href= "#" > This notation.
But the href attribute can also identify JavaScript snippets.
Where javascript: is a pseudo-protocol. It allows us to invoke JavaScript functions through a link. But because this function is empty, we call an empty function, and there is no real change. You can also implement a-tag click-to-run. If there is a lot of content inside the page, there is a scroll bar, using href= "#" will jump to the top of the page problem. Instead of using href= "javascript:;" You can avoid page jumps!
So, if we want to write a dead a tag, use
<href= "javascript:;" ></ a >
will be more conducive to increasing the user-friendliness of our pages!
Transferred from: http://blog.csdn.net/u011277123/article/details/53389898
A href= "javascript:" with a href= "#"