windows open Pop-up window and the same window opens a new tab page

Source: Internet
Author: User

<! DOCTYPE html>Baidu a bit</a> <!--onclick = ' return false ', click Not to jump--<script type= "Text/javascript" >//Auxiliary Functions            varAddloadevent =function(func) {varOldonload =window.onload; //Save the existing, if there is already                if(typeofWindow.onload!== ' function ') {window.onload=func; } Else{window.onload=function() {oldonload ();                    Func ();            }}} addloadevent (Preparelinks); //Main function            functionpreparelinks () {//It is expressed here as var preparelinks = function () {, the function is invalid, so it does not run???                 if(!document.getelementsbytagname)return false; varLinks =document.getelementsbytagname (' a ');  for(vari = 0; i < links.length; i++) {                    if(Links[i].getattribute (' class ') = = ' Popup ') {                        //contains a judgment on the existence of ' popup 'Links[i].onclick =function(){                            returnPopUp ( This. getattribute ("href"))?false:true; //return!popup (This.getattribute ("href"));                        }                    }                }            }            //Click the link does not jump page, pop-up window            varPopUp =function(Winurl) {window.open (Winurl,"Popup", "Resizable,scrollbars,status"); return true; }            //if the popUp is changed to the following, click on the link to open the New tab page in the same window            //var popUp = function (winurl) {            //window.open (winurl, ' _blank ');            //return true;            // }</script> </body>

windows open Pop-up window and the same window opens a new tab page

Related Article

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.