[ale] OT: XMLHTTP + IE

cfowler cfowler at outpostsentinel.com
Fri Dec 15 10:32:17 EST 2006


I should try this code instead.  What was strange is that I woke up this
morning and on my screen I was still tailing the apache access_log.  I
noticed that IS tried to access the alarm_check.pl CGI
66.23.198.138 - - [14/Dec/2006:22:37:50 -0500] "GET /SC/Test/alarm.pl
HTTP/1.1" 200 295 
66.23.198.138 - - [14/Dec/2006:22:37:51 -0500] "GET /SC/Test/Alarm.js
HTTP/1.1" 200 867
66.23.224.81 - - [15/Dec/2006:06:03:17 -0500]
"GET /SC/Test/alarm_check.pl HTTP/1.1" 200 51

Last night at 22:37 I did a refresh in IE.  The req.open() code did not
call alarm_check.pl until 06:03 this morning.  Very strange...




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