当前位置: 首页 > 图文教程 > 网络编程 > Javascript > [原创]站长必须要知道的javascript广告代码

Javascript
Javascript初学者实例教程(5):Document对象
JS初学者实例教程(6):Document对象读取表单元素
JS初学者实例教程(7):注册表单验证
JS初学者实例教程(8):单选按钮、复选按钮
JS初学者实例教程(9):下拉菜单和链接属性
Javascript初学者实例教程(11):鼠标动作
Javascript初学者实例教程(12):访问XML节点
JavaScript类
网页内应用JS的最好方法
JS两种定义Function非常常用的方法
网页JavaScript运行时IE产生警告栏解决方法
处理大量JavaScript对象的好选择:JSON
JSON(JavaScript Object Notation)
javascript用法:break,continue和return语句
JS获取各种浏览器窗口的大小
JavaScript发展与互联网
IE地址栏实现的JS有趣效果和应用
Javascript如何应用到网页中
Javascript条件判断语句的小技巧
Firebug Lite使用在IE、Opera、Safari浏览器

Javascript 中的 [原创]站长必须要知道的javascript广告代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-10   浏览: 138 ::
收藏到网摘: n/a

参考了sina的代码,想出来的一个代码,请大家使用,不要传播,转载请注明:来自软晨学习网
<!--
//时间计算
var showit=false;
var today=new Date();
var urlpath;
function testdate()
{
urlpath='http://www.scripthome.net/bbs';showit=true
if(today.getHours()>='10' && today.getHours()<'12')
{
urlpath='http://www.ruanchen.com';showit=true
}
}
testdate();
var MSIE=navigator.userAgent.indexOf("MSIE");
var OPER=navigator.userAgent.indexOf("Opera");
if(showit==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 = urlpath;
setTimeout("hidediv()",5000)
}
function hidediv(){
document.getElementById('hiddenLayer').style.display="none";
SYtag=2;
}
function showfull(){
setTimeout("changediv()",2000);
}
showfull();
}}
if(showit==true)
{
if (document.all && MSIE!=-1 && OPER==-1) {
// this is a 4.x browser, no?
document.write('<DIV ID="hiddenLayer" style="display: none; height: 0">');
expandableIframe = '<IFRAME id="interstitialframe" width=0 HEIGHT=0 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0></IFRAME>';
document.write(expandableIframe);
}
document.write('</div>');
}
// -->