The jQuery onReady event handler gets invoked before setState is defined in IE7:
- $(function() {
- $.route.ready();
- });
triggering this code:
- ready: function(val) {
- if( val === false ) {
- onready = false;
- }
- if( val === true || onready === true ) {
- setState();
- }
- return $.route;
- },
which throws a JavaScript runtime error because setState is defined later in the file.
I tried delaying the onready event by calling $.holdReady(true) but the ready event is triggered before $.holdReady is executed.
This bug appears to be fixed in the CanJS version of route.js where the onready even handler is bound after the setState method is defined:
https://github.com/bitovi/canjs/blob/master/route/route.js#L471
but this defect has not been fixed in Javascript MVC 3.2.4. Are there plans to fix this defect in future releases of JavaScriptMVC?