一天显示一次广告JS代码

sadwind2023-08-08笔记483
window.onload = function () {         
        var s = document.cookie;  
        if (s.indexOf('myad=1') != -1) return;  
        var d = new Date();  
        d.setHours(d.getHours() + 24); 
        document.cookie = 'myad=1;expires='+d.toGMTString();       
        
    }


一天显示一次广告JS代码

function setUCookie(u_name,value){
    var exdate=new Date()
    exdate.setHours(exdate.getHours() + 8); 
    document.cookie=u_name+ "=" +escape(value)+"; expires="+exdate.toGMTString();}function getUCookie(u_name){
    if (document.cookie.length>0){ 
        u_start=document.cookie.indexOf(u_name + "=")
    if (u_start!=-1){ 
        u_start=u_start + u_name.length+1 
        u_end=document.cookie.indexOf(";",u_start)
        if (u_end==-1) u_end=document.cookie.length            return unescape(document.cookie.substring(u_start,u_end))
        } 
    }
    return ""}function _setTimeout(){
    if(getUCookie("uTimeCookie")!=1){document.writeln("");
    }}_setTimeout()setUCookie("uTimeCookie","1");


relate content

如何记数据库中数据重新恢复ID连续

这是一个不是问题的问题,只是针对一些强迫症才有这种想法。大家都知道数据库中的记录主键ID是自增连续的,如果删除了某一行数据,再添加新数据,那条被删除的ID也不会再出现了,对于一些强迫症来说,看着ID不...

VUE学习:十二.性能优化

前言总结一些项目开发中常见的优化技巧,优化的目的不仅能使代码结构更加清晰,加快开发编译速度,而且也能提高线上代码的性能#1.懒加载#2.dllplugin#3.整合模块多页应用中入口文件相同的配置需要...

教程:PPT设计进阶·从基础操作到高级创意

教程:PPT设计进阶·从基础操作到高级创意

PPT设计进阶·从基础操作到高级创意职场中有种说法是,“会做PPT者得天下”。会做且做好 PPT ,到底有多重要?一设计总监曾因在国际体验设计大会上展示的PPT太丑,产生了严重的危机公关,他也因此丢了...

VUE学习:三.VueCLI 配置

前言掌握一些项目中常见的 webpack 配置,能够从容应对一些开发场景问题#1.vue-cli 2.x#1.1 css 相关style-loader ( 处理 style 内联样式 )css-loa...

LayUI在弹出层中刷新父页面的表格数据

 parent.layui.table.reload(      '父页面表格ID',   &nbs...

TP6 一条数据库查询代码 column索引值理解

// 返回数组 Db::table('think_user')->where('status',1)->column('name'...

Post Reply    

◎Welcome to participate in the discussion.