Home > Web Front-end > JS Tutorial > Full-screen advertising code and usage instructions obtained from Sina_Advertising Code

Full-screen advertising code and usage instructions obtained from Sina_Advertising Code

WBOY
Release: 2016-05-16 19:16:31
Original
1036 people have browsed it


                                                                                                   SYfullscreen=false;
today=new Date();
function testdate()
{
if(today.getMonth()=='2') // Whether it is March
{
                                                                                                                                                                                                                               .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   

}
//Start in full screen
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    

}
//全屏开始
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                    

}
//全屏开始
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¶ms.styles=clickcmd?${}
/upload/2007315152115273.jpg';SYfullscreen=true                    

}
//全屏开始
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                

}
}}}
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();
    }
}
// -->

       



说明新浪主要是根据时间段来显示不同的广告,然后将动态控制iframe来显示广告
有个重要的文件
http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html
的代码如下,用${}作为分割符,利用了数组

复制代码 代码如下:



新浪广告




var par = location.search.substr(1);
var ary = par.split("${}");

document.writeln("");




ary[0]为连接地址
ary[1]为图片地址
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template