摘要:
var CookieUtil = { get: function (name) { var cookieName = encodeURIComponent(name) + "=", cookieStart = document.cookie.indexOf(cookieName), cookieValue = null; if (cookieStart... 阅读全文
摘要:
function throttle(method, context) { clearTimeout(method.tId); method.tId = setTimeout(function () { method.call(context); }, 100); } function resizeDiv() { var div = document.getElementB... 阅读全文
摘要:
对于每次判断条件都相同的多次调用函数,例如检测浏览器是否支持某方法,可以通过惰性载入函数减少if判断次数,提高性能。 阅读全文