UPDATE: The problem only occurs when I use an older version of jQuery (1.3.2) and not on the newest version (1.4.2).
ORIGINAL QUESTION:
I have found a weird behavior, and am wondering if there are any work-arounds. The javascript 'for' loop can be used to enumerate the property names of an object. I am finding though that on IE it does not work for some objects, particularly an XMLHttpRequest. Consider the following code. It will open an alert box for every property on the XMLHttpRequest on Firefox. On IE however, no properties are found. If I step through with the debugger, there are definitely properties on the object. If I use jQuery's $.for() function, I see the same result.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function() {
$.ajax({
url: "/willneverwork/",
timeout: 1,
error: function(xmlHttpRequest) {
for (key in xmlHttpRequest) {
alert(key);
}
}
});
});
</script>
</head>
<body>
</body>
</html>