[Prototype-core] simulating readystate

2007-07-12 Thread codefool
One thing I'm running into with Ajax is dynamically loading scripts. Once the

[Prototype-core] Re: simulating readystate

2007-07-12 Thread Jeff Watkins
How about something similar to the dojo.require technique of dynamically loading JS modules? The secret here is to use a synchronous Ajax request. The only drawback is the modules aren't very debuggable, because they weren't loaded via SCRIPT tags. On Jul 12, 2007, at 4:56 AM, codefool wr

[Prototype-core] Event.observe will destroy the scope of Javascript OOP?

2007-07-12 Thread Paladin
I discovered a funny pheno, which I don't know anyone else has stated this before. Say I define a class: function Cat(){ this.color = "yellow"; } Cat.prototype.showColor = function(){ alert(this.color) } Cat.prototype.init(){ Event.observe("button", "click", this.showColor); } //

[Prototype-core] Re: Event.observe will destroy the scope of Javascript OOP?

2007-07-12 Thread jdalton
This is JavaScript issue and not a Prototype issue. http://www.prototypejs.org/api/event/observe Read the section titled "The tricky case of methods that need this" Event.observe("button", "click", this.showColor.bind(this)); //should work --~--~-~--~~~---~--~-

[Prototype-core] Re: Event.observe will destroy the scope of Javascript OOP?

2007-07-12 Thread Paladin
Thanks. Sometimes when bugs pop out it's really difficult to tell where they come from.=) On Jul 12, 4:46 pm, jdalton <[EMAIL PROTECTED]> wrote: > This is JavaScript issue and not a Prototype issue. > > http://www.prototypejs.org/api/event/observe > Read the section titled "The tricky case of met