zoukankan      html  css  js  c++  java
  • 一天弹出一次广告cookie

    function setCookie(name, value, expire) {
    window.document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
    }
    function getCookie(Name) {
    var search = Name + "=";
    if (window.document.cookie.length > 0) {
    offset = window.document.cookie.indexOf(search);
    if (offset != -1) {
    offset += search.length;
    end = window.document.cookie.indexOf(";", offset);

    if (end == -1)
    end = window.document.cookie.length;
    return unescape(window.document.cookie.substring(offset, end));
    }
    }
    return null;
    }
    function register(name) {
    var today = new Date();
    var expires = new Date();
    expires.setTime(today.getTime() + 1000*60*60*24);
    setCookie("ItDoor", name, expires);
    }
    function openWin() {
    var c = getCookie("ItDoor");
    if (c != null) {
    return;
    }
    register("xiaolin");
    if($("#ad-c").find("img").attr("src") !="" && $("#ad-c").find("img").attr("src") !=undefined){
    $("#ad-pop,#ad-c").show();
    }


    }
    $(function(){
    $("#js-close,#ad-pop,#ad-c").click(function(){
    $("#ad-pop,#ad-c").hide();
    });
    });
    openWin();

  • 相关阅读:
    Linux Vim编辑器
    Linux sed 流编辑器
    Shell 编程 (变量和条件测试)
    Linux 下 Bash配置文件读取
    Linux 用户、权限
    Linux 指令(一)文件/目录操作
    Ubuntu 下安装 Swoole
    Mysql IN语句查询
    Mysql 查询优化
    Mysql 获取表属性
  • 原文地址:https://www.cnblogs.com/xiaotaiyang/p/4333097.html
Copyright © 2011-2022 走看看