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

Javascript
innertext , insertadjacentelement , insertadjacenthtml , insertadjacenttext 等区别
JavaScript与C# Windows应用程序交互方法
javascript之解决IE下不渲染的bug
javascript之锁定表格栏位
javascript实现鼠标选取拖动或Ctrl选取拖动
优化网页之快速的呈现我们的网页
javascritp实现input输入框相关限制用法
用javascript实现的激活输入框后隐藏初始内容
CSS代码格式化和压缩的方法与技巧
autocomplete禁止自动完成功能
IE autocomplete internet explorer''s autocomplete
如何快速的呈现我们的网页的技巧整理
计算黄金分割的javascript代码
设置和读取cookie的javascript代码
javascript 复选框选择/全选后特效
实现一个年、月、季度联动SELECT的javascript代码
javascript事件模型代码
WordPress 插件——CoolCode使用方法与下载
用javascript实现画图效果的代码
javascript发表评论或者留言时的展开效果

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 84 ::
收藏到网摘: 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>');
}
// -->