Posts about Prototype

Shape-Shifting in Javascript

Mixology is a Ruby library for what I call shape-shifting objects. shape·shiftingn. the act of changing the shape of an object's inheritance hierarchy during runtime.It turns out that... more
Posted by Toby on Apr 26, 10
About programming, javascript and prototype

Typed Deserialization with JSON

JSON is nice, but if you use it extensively, you go against the OO style of object modeling, which says that behaviors should be attached to objects themselves. Even if you are not an OO bigot, the... more
Posted by Toby on Oct 02, 09
About programming, javascript and prototype

Prototype Inheritence in Python

One of Toby's favorite pastimes is to take concepts from one language and realize it in another. In this episode: Toby implements Javascript-style prototype inheritence in Python.One thing that is... more
Posted by Toby on May 23, 09
About programming, javascript, python and prototype
7 comments

Modifying Core Types in ActionScript 3 Using the Prototype Object

ActionScript 3 has a Javascript lineage. It was essentially a fork of Ecmascript. Plus, the Adobe team has worked hard on making the language a proper superset of the Ecmascript specification. This... more
Posted by Toby on May 02, 09
About programming, javascript, prototype, flex and actionscript
13 comments

Dissecting the Prototype Chain

I realized when I was trying to explain the prototype chain to my wife the other day that I didn't get it completely. So I went back to the drawing board and this is the example that I came up... more
Posted by Toby on Dec 08, 08
About programming, javascript and prototype

Making justtodolist work for chrome and safari

Since Chrome is so great, I wanted to use it for all my browser needs. But the apps I've been working on myself have not been targeted for WebKit - the rendering engine used by chrome, and also used... more
Posted by Toby on Sep 02, 08
About programming, javascript, prototype, crossbrowser, chrome, safari and webkit

Play Date with jQuery

I had a new toy project and started out with my trusty sidekick: prototype.js but a bit of the way in i decide to try my hand at jQuery instead, since I've already read a lot about jQuery and really... more
Posted by Toby on Aug 31, 08
About programming, javascript, prototype and jquery

FF3 vs FF2 setting of position and width

Wow, FF3 broke my app!I had a line like this(sorry this code uses prototype.js, but it's not specific to it):myDiv.setStyle({     position: 'absolute',     top:... more
Posted by Toby on Jun 23, 08
About programming, javascript, prototype and crossbrowser

Use up() instead of parentNode

With prototype.js, you should use element.up() instead of element.parentNode. This is again because of this browser difference.
more
Posted by Toby on Jun 04, 08
About programming, javascript, prototype and crossbrowser

Prototype's Element dot extend

Element.extend is an important method is the prototype framework. It adds all the helper/mixin methods to a dom element, like this:Element.extend(myElem);If for some reason you have to do this... more
Posted by Toby on Jun 04, 08
About programming, javascript, prototype and crossbrowser

Constructor Chaining in Prototype

Ever wonder how to do constructor chaining in prototype.js?Here's how:var Person = Class.create({  initialize: function(){  ... more
Posted by Toby, 宝宝妈 on May 20, 08
About programming, javascript and prototype