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

Javascript
可实现多表单提交的javascript函数
比较详细的关于javascript中void(0)的具体含义解释
随机显示经典句子或诗歌的javascript脚本
javascript实现的多条新闻公告系统
解析arp病毒背后利用的Javascript技术附解密方法
比较详细的javascript对象的property和prototype是什么一种关系
访问百度和谷歌网速测试的javascript代码
javascript 动态改变层的Z-INDEX的代码style.zIndex
javascript+css实现单击颜色褪去效果
javascript 表单日期选择效果
比较简单的javascript实现input双击后可以编辑
javascript实现的颜色块滑动的动态效果
js实现网页检测是否安装了 Flash Player 插件
javascript 实现父窗口引用弹出窗口的值的脚本
javascript 实现双击才能打开链接的方法
用javascript实现兼容IE7的类库 IE7_0_9.zip提供下载
document.createElement("A")比较不错的属性
用javascript实现不按Ctrl实现Multiple Select多选
JavaScript-世界上误解最深的语言分析
IE和Mozilla的兼容性汇总event

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


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