One of the usual ways that webmasters used to let the user click on the ads to see the real content, the most use is to click on ads after the display download address, this function is very helpful to advertising revenue, but lost the user experience, as far as possible or not to use the frequency, the code sent up, It's mainly for learning JavaScript.
The code is as follows |
Copy Code |
<base target= "_blank" onclick= "javascript:will ()"/> <script language= "JavaScript" type= "Text/javascript" > function would () { if (event.srcelement.tagname== ' A ' | | event.srcelement.tagname== ' IMG ') { Window.focus (); OUrl.style.display = ""; YAd.style.display = "None"; Document.cookie= ' Goodfont=yes '; } } function Get_cookie (Name) { var search = Name + "=" var returnvalue = ""; if (Document.cookie.length > 0) { offset = document.cookie.indexOf (search) if (offset!=-1) { Offset + = Search.length End = Document.cookie.indexOf (";", offset); if (end = = 1) end = Document.cookie.length; Returnvalue=unescape (document.cookie.substring (offset, end)) } } Return returnvalue; } </script> <!--This is the ad code--> <div id= "YAd" > <a href= ' # ' target=_blank> dot this ad, show download address </a> </div> <!--here is the real download address--> <div id= "Ourl" style= "display: ' None '" > <script language= "JavaScript" >function Jydownh (htmlurl) {var newwin=window.open (htmlurl, ', ' Toolbar=no, Location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no '); return false;} </script> <a href= '/down/test.rar ' target=_blank> real download address </A> </div> |
Note: The above code eliminates the