Drupal = {};Drupal.theme = function (func) { console.log(arguments); var args = Array.prototype.slice.apply(arguments,['1']); console.log(args); r...
分类:
其他好文 时间:
2015-12-30 13:39:06
阅读次数:
114
js职责链模式 的简单理解。大叔的代码太高深了,不好理解。function Handler(s) { this.successor = s || null; this.handle = function () { if (this.successor) { ...
分类:
Web程序 时间:
2015-12-30 13:24:18
阅读次数:
197
V8中的Function.prototype.bind有50倍性能的提升Chrome Canary版中的js最新性能已经完成了91%年底的时候,ES6的支持情况:chrome:91% (w. flag), FF — 90% (unflagged!), Edge — 90% (flagged), We...
分类:
其他好文 时间:
2015-12-30 13:22:06
阅读次数:
142
html$.post("url",{id:id},function(data){ for(var i=0,l=data.length;i"+data[i]['id']+""+data[i]['username']+""+data[i]['email']+""); } },"json")ph...
分类:
Web程序 时间:
2015-12-30 13:17:07
阅读次数:
161
首先看下Prototype里的写法:var Class = { create: function() { return function() { this.init.apply(this, arguments); } } } var A = Class.create(); A.prototype =...
分类:
Web程序 时间:
2015-12-30 13:15:20
阅读次数:
146
jquery如何实现点击回车键触发事件:有时候我们想点击回车的时候能够让代码去干一些事情,这个时候我们就需要判断按下的键是否是回车,下面就简单介绍一下如何实现此功能,核心代码如下:$(function (){ document.onkeydown=function(ev) { var...
分类:
Web程序 时间:
2015-12-30 13:12:18
阅读次数:
177
这是对《高级3》的P156页,原型的动态性的理解function Person(){ } var oldproto = Person.prototype; var friend = new Person(); Person.prototype = { const...
分类:
其他好文 时间:
2015-12-30 11:31:55
阅读次数:
243
写个函数判断是否为空 function checkform() { if($("#pname").val()=='') { alert('姓名不能为空!'); return false; }}
分类:
其他好文 时间:
2015-12-30 11:12:25
阅读次数:
123
// 禁用右键菜单、复制、选择$(document).bind("contextmenu copy selectstart", function() {returnfalse;});// 禁用Ctrl+C和Ctrl+V(所有浏览器均支持)$(document).keydown(function(e)...
分类:
Web程序 时间:
2015-12-30 09:20:24
阅读次数:
165
function getPhoneType() { //正则,忽略大小写 var pattern_phone = new RegExp("iphone", "i"); var pattern_android = new RegExp("android...
分类:
移动开发 时间:
2015-12-30 09:19:48
阅读次数:
264