Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
fixing #2 scope/closure problem #4
The wrong jsonp-function was removed (always the last one), if you did multiple calls to waveform.js in short succession. also fixes polluted window scope with jsonpN properties.
To confirm the bug:
The problem is, that the variable jsonp is not a local variable but a closure. It will therefore be used as a reference for ALL jsonp-Callbacks. Thus it has the same (i.e. last) value for all callbacks. We solve this, by referencing a local variable that is individual to every jsonp-callback.
You can also see this here (original JSONP-Code)