Home > Web Front-end > JS Tutorial > Explanation of the problem of automatically adding # sign to the URL address_javascript skills

Explanation of the problem of automatically adding # sign to the URL address_javascript skills

WBOY
Release: 2016-05-16 18:20:54
Original
1144 people have browsed it

In web development, sometimes when writing click events for hyperlinks, I like to write like this:

 Operation

Once I used jquery to submit an ajax request, the url parameters of the current page A # sign will be automatically added at the end. I was puzzled at first and struggled for a long time. It turned out to be a problem with this writing method. After replacing it with href="javascript:void(0);", the problem no longer occurred.

Note: # Contains a location information, the default anchor point is #top, which is the top of the web page, and javascript:void(0) only represents a dead link.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template