摘要: //cookie设置和获取 var Cookies = function(){ this.setCookie = function (name,value,time){ var expires = ""; if(time>0){ expires = ";expires=" + time; } cons... 阅读全文
posted @ 2018-06-09 14:58 猿人笔记 阅读(180) 评论(0) 推荐(0) 编辑
摘要: //长按事件触发 $.fn.longPress = function(fn) { var timeout = undefined; var $this = this; for(var i = 0; i < $this.length; i++) { (function(target) { var timeout; target.... 阅读全文
posted @ 2018-06-09 14:57 猿人笔记 阅读(2515) 评论(0) 推荐(0) 编辑
摘要: 目前看到最可靠的redis抢购程序。首先用Redis的队列模式进行抢购,当抢到的用户保存在另外一个队列当中。然后用户进入 判断是否抢到商品生成订单 文章提供仅提供参考! 阅读全文
posted @ 2018-06-09 14:52 猿人笔记 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 在PHP源码中redis是可以直接new redis的,但是在thinkPHP5中直接new的话会直接报致命的错误,错误的信息说没有引用名空间。以下是简单的调用redis的代码 致命错误: Class 'app\home\controller\Redis' not found thinkPHP5.0 阅读全文
posted @ 2018-06-09 11:06 猿人笔记 阅读(218) 评论(0) 推荐(0) 编辑