[jquery-dev] Re: Javascript syntax oddity

2009-09-14 Thread ajp771
Reading the specs, it becomes clear that all vars are instantiated before execution (Matt said parsed, but to avoid doubt their values aren't evaluated). Thus: function() { myVar = 5; var myVar = 6; } is the equivalent of: function() { var myVar; myVar = 5; myVar = 6; } is valid

[jquery-dev] Re: Javascript syntax oddity

2009-09-14 Thread ajp771
Yes, I can see why it happens, but I was surprised because I imagined that the first time the script is parsed by the internal engine, it need to know what the doSomething() method applied to, and create some sort of pointer to that object. But in fact it doesn't care what it's applied to, it does

[jquery-dev] Re: Image load event - some progress

2009-02-27 Thread ajp771
Quick follow up - webkit won't re-fire the events on this.src = this.src, but this unattractive modification will work fortunately it doesn't generate any request, nor fire the error event, nor cause any flicker: var src = this.src; this.src = '#';