- Need to click on the link page effect in one order, some front-end developers named it "first click after Link", need to follow the requirements of a click link before the specified link to take effect, remember that this function is often used in advertising above, users do not click on the ads, you can not activate a link, but this function is a bit annoying ah, Or do not use as well, this code is only for learning a programming idea.
<HTML><Head><Scriptlanguage= "JavaScript">varNum= 3; //Total LinksvarMyPage= 'http://www.baidu.com'; //Destination link AddressvarPissoff= 'Please enter NetEase 163 first from above, only then can enter Baidu's homepage from here';//here is the tip message Allow=Array (); //Open ArrayAllow[num]= 2; //the last link is the one that ultimately needs to be clicked.functiongotoit (link) {//Record Click Status if(Link!=num) { //If the click is not the last oneAllow[link]= 2; //The link that is currently clicked is logged } Else { //otherwise (a link needs to be checked) for(i=1; I<=Num;i++){ //Check the click status of each previous link if(Allow[i]!= 2){ //If a link has not been clickedI=Num+ 1; //prepare to exit the loopLemmein= 0; //set flag, do not allow links } Else { //otherwise (each of the preceding has been clicked)Lemmein= 1; //setting the Allow flag } } if(Lemmein== 1){ //if the link is allowedwindow.location=MyPage;//navigation is done by changing the window location } Else { //otherwisealert (Pissoff); //Pop-up tip information } }}//---></Script><styletype= "Text/css"><!--A{Color:000000;font-size:11pt;text-decoration:None}a:hover{Color:a0a0a0} -</style><title>Shijiazhuang Slag slurry Pump Parts</title></Head><Body><P><b><ahref= "Http://www.163.com"OnClick= "Gotoit (1)"Target= "_blank">To enter Baidu Search, you must first click here to enter NetEase</u></a><BR></b><P><b><ahref="/"OnClick= "Gotoit (2)"Target= "_blank"The occurrence of > Hair</u></a><BR></b><P><b><ahref= "Javascript:gotoit (num)">Finally can enter Baidu search from here OH</a></b></Body></HTML>