开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 1473|回复: 6
收起左侧

[求助] js问题 大神来解决一下

[复制链接]
头像被屏蔽
结帖率:96% (47/49)
发表于 2017-2-10 21:06:07 | 显示全部楼层 |阅读模式   浙江省温州市
  1. /*!
  2. * jQuery Cookie Plugin v1.4.1
  3. * https://github.com/carhartl/jquery-cookie
  4. *
  5. * Copyright 2013 Klaus Hartl
  6. * Released under the MIT license
  7. */
  8. (function (factory) {
  9.         if (typeof define === 'function' && define.amd) {
  10.                 // AMD
  11.                 define(['jquery'], factory);
  12.         } else if (typeof exports === 'object') {
  13.                 // CommonJS
  14.                 factory(require('jquery'));
  15.         } else {
  16.                 // Browser globals
  17.                 factory(jQuery);
  18.         }
  19. }(function ($) {

  20.         var pluses = /\+/g;

  21.         function encode(s) {
  22.                 return config.raw ? s : encodeURIComponent(s);
  23.         }

  24.         function decode(s) {
  25.                 return config.raw ? s : decodeURIComponent(s);
  26.         }

  27.         function stringifyCookieValue(value) {
  28.                 return encode(config.json ? JSON.stringify(value) : String(value));
  29.         }

  30.         function parseCookieValue(s) {
  31.                 if (s.indexOf('"') === 0) {
  32.                         // This is a quoted cookie as according to RFC2068, unescape...
  33.                         s = s.slice(1, -1).replace(/\"/g, '"').replace(/\\\\/g, '\\');
  34.                 }

  35.                 try {
  36.                         // Replace server-side written pluses with spaces.
  37.                         // If we can't decode the cookie, ignore it, it's unusable.
  38.                         // If we can't parse the cookie, ignore it, it's unusable.
  39.                         s = decodeURIComponent(s.replace(pluses, ' '));
  40.                         return config.json ? JSON.parse(s) : s;
  41.                 } catch(e) {}
  42.         }

  43.         function read(s, converter) {
  44.                 var value = config.raw ? s : parseCookieValue(s);
  45.                 return $.isFunction(converter) ? converter(value) : value;
  46.         }

  47.         var config = $.cookie = function (key, value, options) {

  48.                 // Write

  49.                 if (value !== undefined && !$.isFunction(value)) {
  50.                         options = $.extend({}, config.defaults, options);

  51.                         if (typeof options.expires === 'number') {
  52.                                 var days = options.expires, t = options.expires = new Date();
  53.                                 t.setTime(+t + days * 864e+5);
  54.                         }

  55.                         return (document.cookie = [
  56.                                 encode(key), '=', stringifyCookieValue(value),
  57.                                 options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
  58.                                 options.path    ? '; path=' + options.path : '',
  59.                                 options.domain  ? '; domain=' + options.domain : '',
  60.                                 options.secure  ? '; secure' : ''
  61.                         ].join(''));
  62.                 }

  63.                 // Read

  64.                 var result = key ? undefined : {};

  65.                 // To prevent the for loop in the first place assign an empty array
  66.                 // in case there are no cookies at all. Also prevents odd result when
  67.                 // calling $.cookie().
  68.                 var cookies = document.cookie ? document.cookie.split('; ') : [];

  69.                 for (var i = 0, l = cookies.length; i < l; i++) {
  70.                         var parts = cookies[i].split('=');
  71.                         var name = decode(parts.shift());
  72.                         var cookie = parts.join('=');

  73.                         if (key && key === name) {
  74.                                 // If second argument (value) is a function it's a converter...
  75.                                 result = read(cookie, value);
  76.                                 break;
  77.                         }

  78.                         // Prevent storing a cookie that we couldn't decode.
  79.                         if (!key && (cookie = read(cookie)) !== undefined) {
  80.                                 result[name] = cookie;
  81.                         }
  82.                 }

  83.                 return result;
  84.         };

  85.         config.defaults = {};

  86.         $.removeCookie = function (key, options) {
  87.                 if ($.cookie(key) === undefined) {
  88.                         return false;
  89.                 }

  90.                 // Must not alter options, thus extending a fresh object...
  91.                 $.cookie(key, '', $.extend({}, options, { expires: -1 }));
  92.                 return !$.cookie(key);
  93.         };

  94. }));
复制代码
上面的是js 算出来的结果是hq24bmrppgecwrn13odzece5 该怎么分析

补充内容 (2017-2-10 21:17):
已经自己解决

结帖率:100% (20/20)
发表于 2017-2-10 21:07:26 | 显示全部楼层   菲律宾
没网址 怎么调试呢??
回复 支持 反对

使用道具 举报

头像被屏蔽
结帖率:96% (47/49)
 楼主| 发表于 2017-2-10 21:08:24 | 显示全部楼层   浙江省温州市
拉面 发表于 2017-2-10 21:07
没网址 怎么调试呢??

能算出同样的结果来 应该就可以了 因为我这个是一个cookie
回复 支持 反对

使用道具 举报

结帖率:95% (19/20)
发表于 2017-2-10 21:19:37 | 显示全部楼层   山东省东营市
拉面 发表于 2017-2-10 21:07
没网址 怎么调试呢??

https:斜杠斜杠github.考姆   这是网址
回复 支持 反对

使用道具 举报

头像被屏蔽
结帖率:96% (47/49)
 楼主| 发表于 2017-2-11 04:12:30 | 显示全部楼层   浙江省温州市
Decimal 发表于 2017-2-10 21:19
https:斜杠斜杠github.考姆   这是网址

厉害了 我的哥
回复 支持 反对

使用道具 举报

头像被屏蔽
结帖率:96% (47/49)
 楼主| 发表于 2017-2-11 04:13:50 | 显示全部楼层   浙江省温州市
@精易客服 @果子 @xiaoyu1986 @冯古屋 我想问我已经自己解决了 能不能把精币退给我
回复 支持 反对

使用道具 举报

结帖率:100% (3/3)

签到天数: 7 天

发表于 2017-2-11 20:56:53 | 显示全部楼层   江苏省苏州市
小李吊炸天 发表于 2017-2-11 04:13
@精易客服 @果子 @xiaoyu1986 @冯古屋 我想问我已经自己解决了 能不能把精币退给我

无答案,申请取消悬赏专帖
http://bbs.125.la/forum.php?mod=viewthread&tid=13971842
(出处: 精易论坛)
回复 支持 反对

使用道具 举报

  高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:wp@125.la
网站简介:精易论坛成立于2009年,是一个程序设计学习交流技术论坛,隶属于揭阳市揭东区精易科技有限公司所有。
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表