You spelled it wrong dude .. Initialize --------------------------------- Dan Simpson [EMAIL PROTECTED] 530.295.7288
On Aug 30, 2008, at 5:24 PM, Scott Olmsted <[EMAIL PROTECTED]> wrote: > > Okay, I'm doing the Peepcode on Javascript and I have the latest > Firebug installed and I'm displaying http://www.prototypejs.org/, so > the latest prototype library is active (it works with other examples). > > Following the Peepcode, I enable the Console and the multi-line > entry box on the right, enter this code > > var Butter = Class.create(); > > Butter.prototype = { > inititalize: function(brand) { > this.brand = brand; > this.melted = false; > }, > > melt: function() { > this.melted = true; > } > }; > > and hit Run; it says > > >>> var Butter = Class.create(); Butter.prototype = {... melt: > function() { this.melted = true; } }; > Object > > which is fine. Then I Clear and close the multi-line entry box and > put this into the single-line entry box at the bottom in slavish > imitation of Geoffrey Grosenbach: > > var parkay = new Butter('Parkay') > > hit Enter and it says > > >>> var parkay = new Butter('Parkay') > TypeError: this.initialize is undefined > > Adding a semicolon produces the same result: > > >>> var parkay = new Butter('Parkay'); > > Anybody got a hint for me? And if you're responding before Tuesday > morning, why aren't you out at play somewhere? > > Thanks, > > Scott > > > --~--~---------~--~----~------------~-------~--~----~ SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby -~----------~----~----~----~------~----~------~--~---
