01 2012 档案

摘要:Function.prototype.method = function(name, func) { this.prototype[name] = func; return this; };String.method('trim', function() { return this.replace(/^\s+|\s+$/g, ''); }); 阅读全文
posted @ 2012-01-30 13:27 柠檬Cool 阅读(278) 评论(0) 推荐(0) 编辑
摘要:e.keycode详解function submitLoginForm(e) {e = window.event || e;if(e.keyCode == 13) {login();}}keycode 8 = BackSpace BackSpacekeycode 9 = Tab Tabkeycode 12 = Clearkeycode 13 = Enterkeycode 16 = Shift_Lkeycode 17 = Control_Lkeycode 18 = Alt_Lkeycode 19 = Pausekeycode 20 = Caps_Lockkeycode 27 = Escape E 阅读全文
posted @ 2012-01-06 10:32 柠檬Cool 阅读(14467) 评论(0) 推荐(0) 编辑
摘要:页面加载完成后开始运行do stuff when DOM is ready 中的语句! $(document).ready(function() { // do stuff when DOM is ready }); 选择器 $(“a”)是一个jquery的选择器(selector) $("")其中的字段就是元素的标记。比如$("div")就是<div></div> click是函数对象的一个方法。方法为点击鼠标事件! 例: $(document).ready(function() { $("a").click 阅读全文
posted @ 2012-01-06 09:58 柠檬Cool 阅读(60542) 评论(0) 推荐(7) 编辑