I read about object oriented JavaScript. This is the link I read, Introduction to Object Oriented JavaScript . However, I also read CakePHP Practical Projects book. I'm trying to understand why they use a class to define a class? From what I read, you should define classes using the function keyword. The code below is an example from a book. Were the authors wrong or is there something I am missing?
var TravelMapprManager = Class.create({ //Constructor initialize: function(map_container) { this.map_container = map_container; //Start the map. Event.observe(window, 'load', this.displayMap.bind(this)); //Observe the map buttons. Event.observe(document, 'dom:loaded', this.initObservers.bind(this)); },
source share