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

Javascript
javaScript 数值型和字符串型之间的转换
从父页面读取和操作iframe中内容方法
IE DOM实现存在的部分问题及解决方法
jqPlot Option配置对象详解
jquery JSON的解析方式
JavaScript 捕获窗口关闭事件
xml 封装与解析(javascript和C#中)
JavaScript 设计模式学习 Singleton
JavaScript 设计模式学习 Factory
javascript CSS画图之基础篇
JavaScript 获取事件对象的注意点
JavaScript Konami Code 实现代码
Google Map API更新实现用户自定义标注坐标
JavaScript this 深入理解
javascript EXCEL 操作类代码
window.parent调用父框架时 ie跟火狐不兼容问题
关于取不到由location.href提交而来的上级页面地址的解决办法
JS input 数字验证代码
网页全屏显示代码说明分析
JS 学习笔记 防止发生命名冲突

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


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