471,122 Members | 1,054 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,122 software developers and data experts.

XMLHttpRequest: problem with IE?

Hi there, I'm playing with XMLHttpRequest and
followed the article by Bill Bercik at
http://www.webpasties.com/xmlHttpRequest/... I'm
having problems getting the last two steps to work
though. The page that I'm working on is here:
http://camshag.co.uk/svg/XMLHttpRequest/. It works
fine in Firefox but there is no output for the zip
code 12345 (for example) on IE. There is no output
in Opera either but I guess that's just one of
those things ;-).
I'd welcome any advice but I'm guessing that this
is something to do with SP2 and security settings
or something...
Cheers, Dom
Jul 23 '05 #1
2 1841


Dominic Myers wrote:

I'm
having problems getting the last two steps to work
though. The page that I'm working on is here:
http://camshag.co.uk/svg/XMLHttpRequest/. It works
fine in Firefox but there is no output for the zip
code 12345 (for example) on IE.


So the problem is that page
<http://camshag.co.uk/svg/XMLHttpRequest/step7/step7.html>
where you get a script error in IE for line
if (!isWorking && (http != false)) {
? You might want to change the strategy to return false and compare to
false and use null instead e.g.

function getHTTPObject() {
var httpRequest = null;
if (typeof XMLHttpRequest != 'undefined') {
httpRequest = new XMLHttpRequest();
}
else if (typeof ActiveXObject != 'undefined') {
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (e) { }
@end @*/
}
return httpRequest;
}

then compare
if (httpRequest != null) {
// use it
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
I thoroughly recommend the Sarissa library for XmlHttpRequest; it
provides a browser-independent interface that avoids these sorts of
problems entirely.

--Phil.

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Matt Kruse | last post: by
13 posts views Thread by TLaufenberg | last post: by
5 posts views Thread by Peter Michaux | last post: by
1 post views Thread by geevaa | last post: by
6 posts views Thread by Patrick Nolan | last post: by
2 posts views Thread by Michael Nemtsev [MVP] | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.