zoukankan      html  css  js  c++  java
  • cookie.js插件

    /*! cookiejs v1.0.23 | MIT (c) 2018 kenny wong | https://github.com/jaywcjlove/cookie.js */
    !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.cookie=t()}(this,function(){"use strict";function c(e){return"string"==typeof(e=JSON.stringify(e))&&/^{[sS]*}$/.test(e)}function o(){if(!(this instanceof o))return new o}o.prototype={get:function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return decodeURI(o.substring(t.length,o.length))}return!1},set:function(e,t,n){if(c(e))for(var r in e)this.set(r,e[r],t,n);else if("string"==typeof e){var o=c(n)?n:{expires:n},i=void 0!==o.expires?o.expires:"",f=void 0!==o.path?";path="+o.path:";path=/",s=o.domain?";domain="+o.domain:"",u=o.secure?";secure":"";"string"==typeof i&&""!==i?i=new Date(i):"number"==typeof i&&(i=new Date(+new Date+864e5*i)),""!==i&&"toGMTString"in i&&(i=";expires="+i.toGMTString()),document.cookie=e+"="+encodeURI(t)+i+f+s+u}},remove:function(e){for(var t=0,n=(e=e instanceof Array?e:Array.prototype.slice.call(arguments)).length;t<n;t++)this.set(e[t],"",-1);return e},clear:function(e){return this.remove(e||function(e){var t=[],n="";for(n in e)t.push(n);return t}(this.all()))},all:function(){if(""===document.cookie)return{};for(var e=document.cookie.split("; "),t={},n=0,r=e.length;n<r;n++){var o=e[n].split("=");t[decodeURI(o[0])]=decodeURI(o[1])}return t}};var i=null,e=function(e,t,n){var r=arguments;return i||(i=o()),0===r.length?i.all():1===r.length&&null===e?i.clear():2!==r.length||t?"string"!=typeof e||t?"string"==typeof e&&t||c(e)?i.set(e,t,n):void 0:i.get(e):i.clear(e)};for(var t in o.prototype)e[t]=o.prototype[t];return e});

  • 相关阅读:
    Android LogCat使用详解
    新时代新潮流WebOS 【20】WebKit的结构与解构
    Android调试的必杀技——反汇编
    真机缺少com.google.android.maps.jar解决方法:
    test
    VMware让ubuntu与win7共享文件方法
    android手机通过笔记本无线wifi上网
    新时代新潮流WebOS 【22】WebKit,鼠标引发的故事
    获取证书
    获取局域网内部机器的MAC地址
  • 原文地址:https://www.cnblogs.com/shangjun6/p/10719169.html
Copyright © 2011-2022 走看看