摘要: 原生函数1 function handleKeyPress(event) {2 if (event.KeyCode == 13) {3 var target = EventUtil.getTarget(event);4 var value = 5 * parseInt(target.value);5 if (value > 10) {6 document.getElementById("error-msg").style.display = "block";7 }8 }9 }解耦后的函数 1... 阅读全文
posted @ 2012-06-17 22:29 小猩猩君 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1 var CookieUtil = { 2 get: function(name) { 3 var cookieName = encodeURIComponent(name) + "=", 4 cookieStart = document.cookie.indexOf(cookieName), 5 cookieValue = null; 6 7 if (cookieStart > -1) { 8 var cookieEnd = document.cookie.indexOf("... 阅读全文
posted @ 2012-06-17 19:22 小猩猩君 阅读(177) 评论(0) 推荐(0) 编辑