Hey I have this code right here:
http://pastie.org/534470
And on line 109 I get an error saying “TypeError: Result of expression ‘this.allVarsDefined’ [undefined] is not a function.”
Scope in javascript is confusing to me. Can anybody see what my problem is? Also do you guys know of any articles that would help me learn about scope in javascript. This is my first time really using JS 🙂
This looks prototype-based. You probably need to set up your notification callback like this:
so that the notify function is bound to the Scrobbler object and gets
thisset to the Scrobbler object instead of the event triggering the function when the timeout occurs.If I’m wrong on you using prototype, you can probably achieve the same effect using