On 9/8/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > limodou wrote: > > I know that prototype extends built-in classes , just like array, > > string, etc, so many things can be easily processed. Does jquery has > > the same things? I can only found that the API seems aimed to jQuery > > instance, and there are no more extensions applied to built-in > > classes. > > > AFAIK thats right. It's a design decision not to extend existing > classes, as that can break code that iterates over properties of > objects. But I'm not sure if this applies to String, too. Eg. extending > String with a trim() method seems to make more sense then $.trim()... > I think extend built-in class prototype is the best way just like prototype.js done. If we create a new type, and hope it could work like String,Array,etc, we must implement many things according String, Array, etc, so it's not very beautiful, and not very useful.
And I think these things should be somewhat infrastructure, of cause we can seperate them into a individual file, so people can import it selectively. -- I like python! My Blog: http://www.donews.net/limodou UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad UliPad Maillist: http://groups.google.com/group/ulipad _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
