sq****@peoriadesignweb.com wrote:
The following code works fine in Firefox/Netscape but wont work in IE.
I suspect the problem is with one of these two simple functions. If
there is no obvious error Ill paste the entire code.
///////////////////////////////////////////////////////
function get_last_updated() {
http.open( 'get', url );
http.onreadystatechange = handleHttpResponse;
http.send(null);
As a guess, the problem is with wherever you've defined the http object.
It should look something like the stuff here:
<URL:http://jibbering.com/2002/4/httprequest.2004.html>
The relevant part is copied below where it the equivalent object is
called xmlhttp.
Creating the object
In Internet Explorer, you create the object using new
ActiveXObject("Msxml2.XMLHTTP") or new
ActiveXObject("Microsoft.XMLHTTP") depending on the version of MSXML
installed. In Mozilla and Safari (and likely in future UA's that
support it) you use new XMLHttpRequest()
This means that you need to show different script to different
browsers, as what works in one, will error in another. The script
below does this, and if it's not supported, the variable is set to
false to allow for appropriate error messages and recovery with
degrading to more normal HTTP transaction methods when the object
isn't available. This degradation is important, even in IE the objects
can often be blocked by slightly raised security settings (popular due
to the commonly exploited holes of course). Where possible degrade,
some approaches are talked about below, if you really can't, I'd
recommend providing an alternative page aswell. GMail for example has
said they'll be providing a less demanding version in the future,
hopefully with no javascript at all, full degradation.
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope
// with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
--
Rob