One thing I'm running into with Ajax is dynamically loading scripts.
Once the
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
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);
}
//
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
--~--~-~--~~~---~--~-
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