[ale] OT: XMLHTTP + IE
cfowler
cfowler at outpostsentinel.com
Fri Dec 15 10:35:20 EST 2006
I added alerts
if(req != null) {
alert("Here #1");
req.open("GET", "/SC/Test/alarm_check.pl", false);
alert("Here #2");
req.send(null);
alert("Here #3");
} else {
alert("Your browser does not support XMLHTTP!");
}
I see all the alerts but on the apache log file I never see an access
attempt for alarm_check.pl?
On Thu, 2006-12-14 at 23:27 -0500, Jay Loden wrote:
>
> Christopher Fowler wrote:
> > 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.
>
> Here's the code I've used when testing using javascript to pull pages from the server.
> It's mostly borrowed from someplace I found online, I forget where. The "getStatus"
> function is what gets called from the html page. Maybe you can compare the code and see if
> there's something obviously different that would cause a problem.
>
>
> -----
>
> * Open a connection to the specified URL, which is
> * intended to respond with an XML message.
> *
> * @param string method The connection method; either "GET" or "POST".
> * @param string url The URL to connect to.
> * @param string toSend The data to send to the server; must be URL encoded.
> * @param function responseHandler The function handling server response.
> */
> function xmlOpen(method, url, toSend, responseHandler){
> if (window.XMLHttpRequest){
> // browser has native support for XMLHttpRequest object
> req = new XMLHttpRequest();
> } else if (window.ActiveXObject){
> // try XMLHTTP ActiveX (Internet Explorer) version
> req = new ActiveXObject("Microsoft.XMLHTTP");
> }
>
> if(req){
> req.onreadystatechange = responseHandler;
> req.open(method, url, true);
> req.setRequestHeader("content-type","application/x-www-form-urlencoded");
> req.send(toSend);
> } else {
> alert('Your browser does not seem to support XMLHttpRequest.');
> }
> }
>
> function getStatus(){
> xmlOpen("GET", "http://jayloden.com/cgi-bin/somescript.cgi", null, myHandler)
> return true;
> }
>
> function myHandler(){
> //write something to the page or whatever
> }
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list