The href thing.

Source: Internet
Author: User

Many websites use <a> tags and href attributes to make links, especially in pagination displays. However, many people do not know much about the use of href.

1,href= "#" this in the page roll back to the top of the meaning, is href= "#top" shorthand. But in jquery mobile this is "back to the previous page" (this feature needs to reference some library files) without rolling back to the top (from: "Building Android Apps with Html,css and Javascript")!

2,href= "" this seems to be an empty link, but in fact it is refreshing the page (except in JQM)!

3,href= "javascript:void (0);" Many sites use this to indicate that the link does not jump links, (for example: Sina Weibo, QQ space), occasionally right-click on the New tab to open the page (or mouse gestures) will open an empty page, the page title is empty, the address bar is javascript:void (0);

4,<a > tags do not set the href attribute , do not set the href attribute of a tag will not inherit the default a label should be the style (such as classic underline and blue Word, the pointer changes to small hands, etc.), so it is not as set as the span label.

5, jquery provides the function (e) {E.preventdefault (); } prevents jumps.

The following are the 2nd, 3, and 4 of the HREF in the JQM performance (note: The Blue light Box is a label containing the href attribute of the default CSS in the JQM representation):

The href thing.

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.