This is partially a request for a workaround, and partially an attempt to get the word out that Internet Explorer's prototype implementation is still faulty.
The following code does not work on Internet Explorer.
XMLHttpRequest.prototype.old = XMLHttpRequest.prototype.open;
var x = new XMLHttpRequest();
x.old("POST", "test", false);
For IE 8 beta, and all previous versions, the XMLHttpRequest.prototype property never existed in the first place. In IE8, it does exist, but you'll get a "Invalid procedure call or argument" error. Internet Explorer doesn't like decoration.
Does anyone know of a workaround for this?
Update:
It has been pointed that I could override the entirety of XMLHttpRequest with a new function and constructor, and then create a wrapper script ala XMLHttpRequest.js. The prototype method is much shorter, so I would still prefer to use it for non-IE browsers.
The problem seems to be that IE 8 recognizes XMLHttpRequest, but not as a function. Active X objects still seem to work. Instead of testing for the existance of window.XMLHtppRequest, I test for the typeof window.XMLHtppRequest. seems to work OK.
I recoded my get request as follows: