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

Javascript
javascript if 的简化代码
javascript下with 的简化代码写法
javascript简化代码 A=alert w=document.writeln
js 调整select 位置的函数
JS应用之禁止抓屏、复制、打印
js加解密 脚本解密
js+vml创建3D页面效果代码
javascript简写效果“神秘的眼睛”
js实现的定时关闭页面或定时提醒效果代码
js 字数统计,区分英汉
js双色时间效果代码
js计算时间过去的时间
一个javascript参数的小问题
textarea支持图形编辑的实现方法
JavaScript面向对象编程
动态生成的IFRAME,设置SRC时的,不同位置带来的影响
JObj预览一个JS的框架
去除有数组中重复的元素
用JObj实现的渐变效果
给自定义对象加上自定义事件的支持的教程

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


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