Today I spent a long time debugging an error in IE8 that said "Object doesn't support this property or method." It was in some testing code. The line was:
hello=$('#divName');
This works perfectly in Firefox.
The solution? You're gonna love this. "hello" is a reserved word in IE. Change it to:
xxx=$('divName');
Works.
Oh, but that's not all. IE8 has it's own definition of window.setTimeout().
The rest of the world defines it thus:
setTimeout(function, milliseconds, arguments);
The 'arguments' are passed to the function when the 'function' is called after the timeout.
IE?
setTimeout(function, milliseconds, language);
Language? It very nicely explains that you can't pass arguments to the callback function. It doesn't explain why it doesn't do this obvious thing that everyone else does.
Solution?
timeoutProxy= function(func, milliseconds, scope, args) { if ($.browser.msie == true) {
setTimeout(function() {
func(scope, args)
}, milliseconds);
}
else {
setTimeout(func, 1000, scope, args);
} }
setTimeout(function() {
func(scope, args)
}, milliseconds);
}
else {
setTimeout(func, 1000, scope, args);
} }
timeoutProxy(setAcceptClicks, 500, this, {});
Arrgggh!!