|
一些下载网站总是诱惑用户先点击广告然后才能显示真实的软件下载地址,究竟是怎么实现的呢?我找了一个<I><I>javascript</I></I>代码,大家可以看看:
- <!-- 开始 -->
- <base target="_blank" onclick="<I><I>javascript</I></I>:will()" />
- <script language="<I><I>javascript</I></I>" type="text/<I><I>javascript</I></I>">
- function will() {
- 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) { // if cookie exists
- offset += search.length
- // set index of beginning of value
- end = document.cookie.indexOf(";", offset);
- // set index of end of cookie value
- if (end == -1)
- end = document.cookie.length;
- returnvalue=unescape(document.cookie.substring(offset, end))
- }
- }
- return returnvalue;
- }
- </script>
- <!-- 广告代码开始 -->
- <div id="yAd">
- <a href='http://www.linwan.com' target=_blank>点此一下就能显示下载地址</a>
- </div>
- <!-- 广告代码结束 -->
- <div id="oUrl" style="display:'none'">
- <script language="<I><I>javascript</I></I>">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='http://www.linwan.com/soft/huaidan.exe' target=_blank>真实下载地址</A>
- </div>
- <!-- 结束 -->
复制代码
|
|