About the target property of a tag

Source: Internet
Author: User

the target property of hyperlink A is not supported by the new specification and has a value of four reserved words:
1._blank <a href= "document.html" target= "_blank" >mydocument</a> The browser will open a new window to display the document.html document
2._parent <a href= "document.html" target= "_parent" >mydocument</a> Point to Parent Frameset document
3._self <a href= "document.html" target= "_self" >mydocument</a> to transfer a document into the current page box
4._top <ahref= "document.html" target= "_top" >mydocument</a> Remove all page boxes and replace frameset documents with document.html
Tip 1: Make someone else's page box cannot reference your webpage, add: <basetarget= "_top" in the file header >
Tip 2: Open the connection in the current page or do a refresh, submit to the current page in the file header plus: <basetarget= "_self" >
Target's stay is disputed, the side of the advocate is mainly to consider the target= "_blank" property is not a good way to solve, and the side of the advocate to come up with the rel and JS solution.
There is one more way: when using the frameset framework, target= "Frame_name", you can specify the target address of a. such as: left navigation:
<Li>      <Divclass= "Li-item"><emclass= "SCM Li-ico IC3"></em>Basic information Management<spanclass= "SCM Arrow"></span></Div>        <DL>        <DD>         <ahref= "comadmin_basic.html"class= "Dd-item"Target= "Main-iframe">Basic information Management<spanclass= "SCM Dd-ar"></span></a>        </DD>         </DL></Li>
content on the right: (using an IFRAME to undertake)
<Divclass= "Ad-main-comment j_maincontent"ID= "Ad-iframe">      <iframename= "Main-iframe"width= "100%"Height= "100%"src=" "frameborder= "0"Seamless></iframe> </Div>

The effect is as follows:

Other methods:
    The way to use JS to jump page:
    <script type= "Text/javascript";
        Functionchangepage (direction) {
Parent.brotherFrameName.location.href (direction);
}
</script>
Then <spanonclick= "Changepage (" Direction_page ") >link_name</span> can

The use of a and JS together
<a href= "Javascript:methodname (); >this is alink</a>

About the target property of a tag

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.