从新浪弄下来的全屏广告代码 与使用说明

所属分类: 网络编程 / JavaScript 阅读数: 489
收藏 0 赞 0 分享
<!--全屏开始--><!--interstitial begin-->
      <SCRIPT language=JavaScript> 
<!--
//时间计算
SYfullscreen=false;
today=new Date();
function testdate()
{
    if(today.getMonth()=='2') //是否为3月
        {
            if(today.getDate()=='15') //是否为15日
            {
<!--725A3E8355CB-->//全屏开始
if(today.getHours()>='14' && today.getHours()<'15')
{    
    adInterPath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=73474,105318,105433&cid=0,0,0&sid=97875&advid=3716&camid=14291&show=ignore&url=http://61.49.38.5/tzhddoc/index.ht
m${}/upload/2007315152115702.jpg';SYfullscreen=true                                

}<!--$$ huiyan/2007-3-15 14:00:01 ~ 2007-3-15 14:59:59/B $-->
<!--4774607C08FD-->//全屏开始
if(today.getHours()>='8' && today.getHours()<'9')
{    
    adInterPath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=73474,105318,105433&cid=0,0,0&sid=97875&advid=3716&camid=14291&show=ignore&url=http://61.49.38.5/tzhddoc/index.ht
m${}/upload/2007315152115903.JPG';SYfullscreen=true                            

}<!--$$ raowei/2007-3-15 ~ 2007-3-16 两天勿撤,谢谢!/B $-->
<!--35F6B37FB5E4-->//全屏开始
if(today.getHours()>='16' && today.getHours()<'17')
{    
    adInterPath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=70483,101960,102064&cid=0,0,0&sid=94712&advid=3254&camid=13506&show=ignore&url=http://www.sagitar.com.cn/${}
/upload/2007315152115985.GIF';SYfullscreen=true                    

}<!--$$ limeng/2007-3-15 16:00:01 ~ 2007-3-15 16:59:59/B $-->
<!--C5EB1D51E54C-->//全屏开始
if(today.getHours()>='17' && today.getHours()<'18')
{    
    adInterPath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=73214,104975,105088&cid=0,0,0&sid=97562&advid=3705&camid=14237&show=ignore&url=http://adclient.dentsu.com.cn/html
.ng/adspec=Flash&adtype=single_dui_lian&affiliate=sina&campaignid=842&channel=aoyun_page&log=0&para;ms.styles=clickcmd?${}
/upload/2007315152115273.jpg';SYfullscreen=true                    

}<!--$$ limeng/2007-3-15 17:00:01 ~ 2007-3-15 17:59:59/B $-->
<!--D4C112442CAF-->//全屏开始
if(today.getHours()>='18' && today.getHours()<'19')
{    
    adInterPath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=73271,105059,105175&cid=0,0,0&sid=97643&advid=3254&camid=14234&show=ignore&url=http://www.sagitar.com.cn/olympic$
{}/upload/2007315152115162.jpg';SYfullscreen=true                

}<!--$$ limeng/2007-3-15 ~ 2007-3-15/B $-->
}}}
testdate();
var MSIE=navigator.userAgent.indexOf("MSIE");
var OPER=navigator.userAgent.indexOf("Opera");
if(SYfullscreen==true)
{
    if (document.all && MSIE!=-1 && OPER==-1) { 
    // this is a 4.x browser, no? 
function changediv(){
    document.getElementById('hiddenLayer').style.display = "block";
    document.getElementById('interstitialFrame').src = adInterPath;
    setTimeout("hidediv()",5000)
}
function hidediv(){
    document.getElementById('hiddenLayer').style.display="none";
    SYtag=2;
}
function showfull(){
    setTimeout("changediv()",2000); 
}
showfull();
    }
}
// -->
</SCRIPT>
      <SCRIPT language=JavaScript> 
<!--
if(SYfullscreen==true)
{
    if (document.all && MSIE!=-1 && OPER==-1) { 
    // this is a 4.x browser, no? 
        document.write('<DIV ID="hiddenLayer" style="display: none; height: 450px;">');

        expandableIframe = '<IFRAME id="interstitialframe" width=750 HEIGHT=450 NORESIZE SCROLLING=No FRAMEBORDER=0 
MARGINHEIGHT=0 MARGINWIDTH=0></IFRAME>';
        document.write(expandableIframe);

}
document.write('</div>');
}
// -->
</SCRIPT>
<!--interstitial end--><!--全屏结束-->
说明新浪主要是根据时间段来显示不同的广告,然后将动态控制iframe来显示广告
有个重要的文件
http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html
的代码如下,用${}作为分割符,利用了数组
复制代码 代码如下:

<html><head>
<meta http-equiv="Content-type" content="text/html; charset=gb2312">
<title>新浪广告</title>
</head>
<body bgcolor=#ffffff topmargin=0 marginheight=0 leftmargin=0 marginwidth=0>
<center>
<script language = javascript>
var par = location.search.substr(1);
var ary = par.split("${}");

document.writeln("<a href='"  + ary[0] + "' target=_blank><img src=" + ary[1] + " width=750 height=450 border=0></a>");
</script>
</center>
</body></html>

ary[0]为连接地址
ary[1]为图片地址
更多精彩内容其他人还在看

Angular使用Md5加密的解决方法

这篇文章主要介绍了Angular使用Md5加密的解决方法,需要的朋友可以参考下
收藏 0 赞 0 分享

详解JS构造函数中this和return

本文通过实例代码给大家介绍了JS构造函数中this和return,需要的朋友参考下吧
收藏 0 赞 0 分享

ES6中Array.find()和findIndex()函数的用法详解

ES6为Array增加了find(),findIndex函数。find()函数用来查找目标元素,找到就返回该元素,找不到返回undefined,而findIndex()函数也是查找目标元素,找到就返回元素的位置,找不到就返回-1。下面通过实例详解,需要的朋友参考下吧
收藏 0 赞 0 分享

JS闭包的几种常见形式实例详解

本文通过实例代码给大家详细介绍了js闭包的几种常见形式,代码简单易懂,非常不错,具有参考借鉴价值,需要的朋友参考下
收藏 0 赞 0 分享

ES6中Array.copyWithin()函数的用法实例详解

ES6为Array增加了copyWithin函数,用于操作当前数组自身,用来把某些个位置的元素复制并覆盖到其他位置上去。下面重点给大家介绍ES6中Array.copyWithin()函数的用法,需要的朋友参考下
收藏 0 赞 0 分享

Javascript 严格模式use strict详解

严格模式:由ECMA-262规范定义的JavaScript标准,对javascrip的限制更强。这篇文章主要介绍了Javascript 严格模式use strict详解 ,需要的朋友可以参考下
收藏 0 赞 0 分享

引入JavaScript时alert弹出框显示中文乱码问题

今天在HTML中引入JavaScript文件运行时,alert弹出的提示框中文显示为乱码,怎么解决此问题呢?下面小编给大家带来了引入JavaScript时alert弹出框显示中文乱码问题的解决方法,一起看看吧
收藏 0 赞 0 分享

AngularJs 延时器、计时器实例代码

这篇文章主要介绍了AngularJs 延时器、计时器实例代码,需要的朋友可以参考下
收藏 0 赞 0 分享

JS分页的实现(同步与异步)

这篇文章主要介绍了JS分页的实现(同步与异步),需要的朋友可以参考下
收藏 0 赞 0 分享

Angularjs自定义指令实现分页插件(DEMO)

由于最近的一个项目使用的是angularjs1.0的版本,涉及到分页查询数据的功能,后来自己就用自定义指令实现了该功能,下面小编把实例demo分享到脚本之家平台,需要的朋友参考下
收藏 0 赞 0 分享
查看更多