Html--a Tag Add click event, Firefox direct display 0

Source: Internet
Author: User

First, the problem description

A click event is added to a tag, and the page gives a direct 0

Second, problem solving

Background debugging mode, the discovery also into the background method, also returned to the page.

Then think of the page to remove most of the content, remove all JS, see if it is a part of the code has a problem, after doing so, found that JS completely removed, only the Click event, the effect is still so.

But there are a few strange places:

1. Into the backstage method, not finished, the page becomes 0

2. No matter what elements are removed from the page, the effect will be the same

3. Look at the browser debugger and find that the request is not responding at all

But the page already shows 0, starting to think there's a problem with the AJAX request, but the rewrite is still the case.

Finally think there must be a problem on the page, but do not know where, so the page only some of the labels to look carefully, some useless are killed.

Finally, there is a problem finding the A-tag href that triggered the event. Ah,!!!!!!!!!!!!!!!!!!!!!!!.

<class= "Preview"  href= "javascript: (0);" > View </a>

Do not know whether others can see out, I am ignorant, a page so much content, this thing really can't find out.

Last time, pay attention to it later.

Correct wording:

<class= "Preview"  href= "javascript:void (0);" > View </a>

Html--a Tag Add click event, Firefox direct display 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.