href= "javascript:;" is to get rid of the default behavior of the A tag, which is the same as href= "javascript:void (0)"
"The following content is reproduced in the original link: http://www.cnblogs.com/xd502djj/archive/2010/11/10/1874107.html"
Links in the page in addition to the general way, if you use JavaScript, there are many ways, here are some ways to open the link using javascript:
1. Open the link using the Open method of window, which opens the link in the development page, can also customize the size of the open page, and so on.
<a href= "Javascript:window.open (' http://www.google.com ', ' _self ')" > Open a link 1</a><br/>
2. Use document. URL property to hit a new page. Not enough of this method seems to work in Firefox.
<a href= "Javascript:document. URL = ' http://www.google.com ' > Open a link 2</a><br/>
3. Use the location's attribute href to open the link.
<a href= "javascript:window.location.href= ' http://www.google.com '" > Open a link 3 </a><br/>
4. Use location method assign to open the link, this effect is the same as in the previous way.
<a href= "javascript:window.location.assign (' http://www.google.com ')" > Open a link 4</a><br/>
5. Use the location method replace to open the link, and the previous assign way slightly different, the difference is that the use of replace when the page is replaced by the URL will not enter the history object, This means that you cannot go back to the page you are replacing.
<a href= "Javascript:window.location.replace (' http://www.google.com ')" > Open a link 5</a><br/>
6. Normal links, of course, this is the most friendly way to search engines, you can also do the specified link to open the window. Only in this way can the linked page be crawled by search engine spiders.
<a href= "http://www.google.com" > Open a link 5</a><br/>
Href=javascript:; Clear the default behavior of the A label