04 2012 档案
摘要:1 //寄生组合式继承 2 function object(o) { 3 function F() {} 4 F.prototype = o; 5 return new F(); 6 } 7 8 function inheritPrototype(subType, superType) { 9 var prototype = object(superType.prototype);10 prototype.constructor = subType;11 subType.prototype = prototype;12 }13 14 func...
阅读全文
摘要:1 //组合继承是Javascript最常用的继承模式 2 function SuperType(name) { 3 this.name = name; 4 this.colors = ["red", "blue", "green"]; 5 } 6 7 SuperType.prototype.sayName = function() { 8 console.log(this.name); 9 };10 11 function SubType(name, age) {12 //继承属性13 SuperType.call(this, na
阅读全文
摘要:1functionSuperType(){2this.property=true;3}45SuperType.prototype.getSuperValue=function(){6returnthis.property;7};89functionSubType(){10this.subproperty=false;11}1213//继承了SuperType14SubType.prototype=newSuperType();1516SubType.prototype.getSuperValue=function(){17returnthis.subproperty;18};1920varin
阅读全文
摘要:/Files/qzsonline/YUI_Compressor.rar文件夹内的yuicompressor.jar 请更新为最新的版本
阅读全文
摘要:官方网站:http://www.sublimetext.com/插件安装一、输入当中的代码:http://wbond.net/sublime_packages/package_control/installation1、BracketHighlighter2、GBK Encoding Support3、jquery4、js Format5、yui compressor6、zenCoding7、SideBarEnhancements
阅读全文
摘要:按对象取值:jQuery代码如下 1 (function ($) { 2 $.getJSON('ajax/test.json', function (data) { 3 var items = []; 4 5 $.each(data.comments, function (key, val) { 6 items.push('<li class="' + 'tag' + val.class + '">' + '<a href="#">' + val.co
阅读全文

浙公网安备 33010602011771号