js实现定时添加代码
来源:互联网 发布:数的读法 c语言 编辑:程序博客网 时间:2024/06/02 20:20
<div id="fashion_tg" style="width:560px;">
</div>
<script>
function formatDate(str) {
return str.replace(/-/g, '\/');
}
function loadAd(param) {
var curTime = new Date(),
startTime = new Date(formatDate(param.startTime)),
endTime = new Date(formatDate(param.endTime)),
container = document.getElementById(param.container);
if (curTime >= startTime && curTime <= endTime) {
container.innerHTML = param.content;
} else {
container.innerHTML = '';
}
}
loadAd({
startTime: '2015-09-21 10:24:00',
endTime: '2015-09-21 20:55:00',
container: 'fashion_tg',
content: '<iframe width="560px" height="130" frameborder="0" scrolling="no" src="http://fashion.sina.com.cn/iframe/150921/index.shtml"></iframe>'
});
</script>
</div>
<script>
function formatDate(str) {
return str.replace(/-/g, '\/');
}
function loadAd(param) {
var curTime = new Date(),
startTime = new Date(formatDate(param.startTime)),
endTime = new Date(formatDate(param.endTime)),
container = document.getElementById(param.container);
if (curTime >= startTime && curTime <= endTime) {
container.innerHTML = param.content;
} else {
container.innerHTML = '';
}
}
loadAd({
startTime: '2015-09-21 10:24:00',
endTime: '2015-09-21 20:55:00',
container: 'fashion_tg',
content: '<iframe width="560px" height="130" frameborder="0" scrolling="no" src="http://fashion.sina.com.cn/iframe/150921/index.shtml"></iframe>'
});
</script>
0 0
- js实现定时添加代码
- 用js代码实现表格的添加
- 页面定时跳转的js和php的代码实现和页面定时刷新
- js定时显示广告代码
- js代码实现填写简历时“添加项目经历”功能
- js添加收藏代码
- 定时关闭页面 定时执行代码的js代码
- 定时关闭页面 定时执行代码的js代码收藏
- JS 实现的定时倒计时
- js定时循环实现秒表
- js实现页面定时跳转
- js 实现定时页面跳转
- js实现页面定时跳转
- js实现页面定时跳转
- js实现页面定时跳转
- js实现页面定时跳转
- Java Web添加定时任务实例代码
- 定时页面定时跳转jquery实现和js实现
- 数据库索引
- 利用JSPatch为controller添加View
- Html5+CSS3+EL表达式问题集锦
- Glide之GlideModule
- OSI 七层模型
- js实现定时添加代码
- UNION 和UNION ALL 的区别
- 数据库设计原则
- 版本问题和获取秘钥签名
- 结构体
- js中的正则表达式
- velocity的HelloWord
- leetcode 231. Power of Two
- Android 友盟第三方消息推送使用