How to Prevent hyperlink jump

Source: Internet
Author: User

<A href = "" OnClick = ""> I encountered some problems, and I was confused for more than a month. Now I have come to the following conclusion from my netizens, which makes my problem easy to understand.

  1. Linked onThe click event is executed first, followed by the action under the href attribute (page Jump, or javasCript pseudo link );
  2. Assume that both href and on exist in the link.Click. If you want to disable the action under the href attributeClick must get a return value of false;
  3. If the page has a scroll bar and you wantClick the event to perform the operation. Set its href attribute to javasSKIP: VO (0); instead of #. This prevents unnecessary page beats;
  4. If a function with a returned value is called in the href attribute of the link, the content on the current page will be replaced by the returned value of this function;
  5. The shift key is different.
  6. The problem I encountered today is that the parentnode cannot be accessed in the form of href in ie6.0.
  7. Try not to use javasProtocol: As the href attribute of A, this will not only trigger unnecessary window. OnBeforeunload event, in IE it will make GIF animation picture stop playing.

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.