[ale] OT: XMLHTTP + IE
Christopher Fowler
cfowler at outpostsentinel.com
Thu Dec 14 17:05:23 EST 2006
I saw the article in LJ 11/06 in regards to AJAX + Caller ID. I decided
to use the code to test and idea that I had with our system. I wrote a
simple CGI program that will get the last key out of a row in a database
table. The java script will use that key to check to see when a new row
is inserted. When a new row exists it will automatically refresh the
page.
This works great in Netscape but fails to work in IE
Here is where I'm having a problem:
function get_from_server() {
var req;
if(window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if(window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
if(req != null) {
req.open("GET", "/SC/Test/alarm_check.pl", false);
req.send(null);
} else {
alert("Your browser does not support XMLHTTP!");
}
return req;
}
It appears that the alarm_check.pl program is never called. I've got
the program dumping to a log file when it is executed and I see that log
file updated every 2 seconds when I access this page in netscape. In
Windows I see nothing. I've used alert() to validate that we are
getting to that part of the code so I know req.open() is getting called.
But nothing is happening. Apache log files also show no attempt by IE
to "GET" the alarm_check.pl program. No JS error messages in IE either.
The JS code is at: http://buford.linxdev.com/Alarm.js Maybe someone
here knows of something I should have done.
More information about the Ale
mailing list