https://static.iklfy.com/static/images/index/23.jpg

jQuery中live()变更

开始的时候在jQuery.1.7.1中使用了.live()觉得很好用,特别是在绑定事件之后再加入的元素的事件绑定上很方便(第一次live之后以后添加的元素就不需要绑定啦)

后来jQuery更新到1.9.1,页面中的.live报错:"has no method live", 后来查了文档才知道在新版本中做了修改。

//jQuery.1.8.3:
$("#liveID").live("click",function(){alert("live click");});

//jQuery.1.9.1:
$(document).on("click","#liveID",function(){alert("live click");});
jQuery网站上这么说的:

As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().

https://static.iklfy.com/static/images/index/11.jpg

jQuery原理(原型)

(function(){ 
  var jQuery = window.jQuery = window.$ = function( selector, context ) {
     return new jQuery.fn.init( selector, context);
  };
  jQuery.fn = jQuery.prototype = {
        init:function(selector, context){
           alert(selector);
        },
      add : function() {
          return this;
        }
   }
   jQuery.fn.init.prototype = jQuery.fn; 
})();   

//$("dd").add();
https://static.iklfy.com/static/images/index/5.jpg

PHP字符串查询函数

function strexists($haystack, $needle)
/**
* 这个看成函数重载也无妨,功能就是查找$haystack是不是在$needle中存在
* @para string $haystack
* @para string $needle
* @return boolean
*/

function strexists($haystack, $needle) {
       return !(strpos($haystack, $needle) === FALSE);
}
https://static.iklfy.com/static/images/index/7.jpg

Discuz 密码错误次数过多导致等待15分钟的解决办法

修改文件:在function/function_member.php
$return = (!$login || (TIMESTAMP - $login['lastupdate'] > 900)) ? 4 : max(0, 5 - $login['count']);

900(s) / 60(s) = 15(m) 等于密码错误等待时间 随便改;
4 等于允许输入 N+1 次的错误密码 ,如 4+1=5 第5次错误提示等待 N(m)后在登录;随便改;

注:引起的问题不要找我 = =。