Hi,
Normally I ignore IEs older than 6 (I don't need that sort of hassle), but recently I tested some _javascript_ I had written for a client in IE5 and it failed. The culprit was Array.push, which for no clear reason IE5 doesn't support. Unfortunately, it's used quite a lot in Mochikit.
I've thought of a few fairly simple solutions (and lots of complicated ones I wont both to list :):
a) Replace all foo.push(bar) with foo[foo.length] = bar;
b) Hack the Array prototype:
if (![].push)
Array.prototype.push = function() {
for (var i = 0; i < arguments.length; i++) {
this[this.length] = arguments[i];
}
return this.length;
};
(code stolen from Dean Edwards' IE7)
c) Create MochiKit.Base.arrayPush, replace all foo.push(bar) with arrayPush( foo, bar )
Questions:
Is this sort of fix MochiKit's job? Mostly I use MochiKit so that I can ignore browser incompatibilities, but IE5 might be too old.
Which method would be prefered? C seems most Mochi, but they all have advantages / disadvantages.
Hamish Friedlander
MindControlDogs
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---
- [mochikit] Array.push and IE5 Hamish Friedlander
- [mochikit] Re: Array.push and IE5 Bob Ippolito
