文章分类 -  prototype

摘要:Prototype’s object for class-based OOP.prototype OOP编程的基础,详细说明一下源码:view plaincopy to clipboardprint?/* Based on Alex Arnell's inheritance implementation. */ var Class = (function() { //临时存储paren... 阅读全文
posted @ 2009-07-29 16:46 麦飞 阅读(339) 评论(0) 推荐(0)
摘要:这个对象就是对function的一些扩充,最重要的当属bind方法,prototype的帮助文档上特意说了一句话:Prototype takes issue with only one aspect of functions: binding.其中wrap方法也很重要,在类继承机制里面就是利用wrap方法来调用父类的同名方法。 argumentNames bind bindAsEventList... 阅读全文
posted @ 2009-07-29 16:00 麦飞 阅读(609) 评论(0) 推荐(0)
摘要:环境:Prototype Version: '1.6.1_rc3'Aptana Studio, build: 1.2.5.023247IE7FF2.0.0.4Opera 10 beta=============================================================view plaincopy to clipboardprint? varPrototype=... 阅读全文
posted @ 2009-07-28 17:27 麦飞 阅读(487) 评论(0) 推荐(0)
摘要:帮助文档上没有这个对象,实际上源代码中这个对象还是有方法的,就1静态方法,作用也不是很大,这里简单说一下,因为以后介绍别的对象时会用到这个RegExp view plaincopy to clipboardprint?RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){returnString(str)... 阅读全文
posted @ 2009-07-28 16:42 麦飞 阅读(211) 评论(0) 推荐(0)
摘要:Part I: http://thinkweb2.com/projects/prototype-checklist/1,错:ruby代码 document.getElementById('foo')document.getElementById('foo')对:ruby代码 $('foo')$('foo')2,错:ruby代码 varwoot=document.getElementById('ba... 阅读全文
posted @ 2009-07-13 09:47 麦飞 阅读(309) 评论(0) 推荐(0)
摘要:在写这个指南之前,先介绍一下Prototype主要是干吗的,如果你比较关注ajax/javascipt方面的应用,你应该早就听说过这个 javascript framework。 Prototype是一个基础的javascript应用框架,先引用一段官方网站的介绍 Prototype is a JavaScript framework that aims to ease development ... 阅读全文
posted @ 2009-06-18 15:45 麦飞 阅读(622) 评论(0) 推荐(0)