I've got a particularly tricky problem using AJAX, which works fine in IE7 and Firefox, but not in IE6.
I have a very simple home-grown AJAX framework, which requires that I extend the XMLHttpRequest object (or in the case of IE, the XMLHttpRequest ActiveXObject) by adding a couple of properties. Relevant section of code is as follows:
//the following is the constructor for our ajax request object - which extends the standard object. It is used in the method below it
function FD_XMLHttpRequest() {
var xmlHttpReq = false;
if (window.XMLHttpRequest) { // Mozilla/Safari
xmlHttpReq = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
//we now have the request object - extend it with things we might need to store with it
xmlHttpReq.onReturnFunc = null; //******ERROR IN IE6******
xmlHttpReq.targetDivId = null; //******ERROR IN IE6******
return xmlHttpReq;
}
//To use:
myXHReq = new FD_XMLHttpRequest();
myXHReq.onReturnFunc = someFunction;
myXHReq.targetDivId = "myDiv";
The problem seems to be that FF and IE7 allow extending an object in this way, but IE6 does not (it complains that "Object doesn't support this property or method"). I've tried using the "prototype" property and various methods of "real" inheritance, but I can't quite get my head around what is going on with IE6