• 网页换肤


    <head>
    <title>网页换肤</title>
    <meta http-equiv="Content-Type" content="text/html" ; charset="UTF-8">
    <link id="myCss" href="orange.css" rel="stylesheet">
    <script language="javascript">
    //写入客户端Cookie
    function writeCookie(csspath) {
    var today = new Date();
    var expires = new Date();
    expires.setTime(today.getTime() + 1000 * 60 * 60 * 24 * 30); //有效期为30天
    var str = "cssPath=" + csspath + ";expires=" + expires.toGMTString()
    + ";";
    document.cookie = str;
    }
    //读取Cookie
    function readCookie(cookieName) {
    var search = cookieName + "=";
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search);
    if (offset != -1) {
    offset += search.length;
    end = document.cookie.indexOf(";", offset);
    if (end == -1) {
    end = document.cookie.length;
    return unescape(document.cookie.substring(offset, end));
    }
    }
    }
    }
    function ifCookie() {
    if (readCookie("cssPath") == undefined) {
    writeCookie("orange.css");
    }
    document.getElementById("myCss").href = readCookie("cssPath");
    }
    function change(type) {
    if (type == "orange") {
    document.getElementById("myCss").href = "orange.css";
    writeCookie("orange.css");
    }
    if (type == "gray") {
    document.getElementById("myCss").href = "gray.css";
    writeCookie("gray.css");
    }
    }
    </script>
    </head>
  • 相关阅读:
    读《被绑架的中国经济》有感
    互联网世界观
    了解360 ~~《我的互联网方法论》
    了解腾讯~~《马化腾的商业帝国》
    nginx 动静分离 以及 负载均衡配置
    linux 常用命令
    solr 配置中文分词器
    solr搜索配置权重
    JDK8集合类源码解析
    JDK8集合类源码解析
  • 原文地址:https://www.cnblogs.com/chaoyuehedy/p/5726993.html
Copyright © 2020-2023  润新知