XMLHttpRequest: problem with IE?

Discussion in 'Javascript' started by Dominic Myers, Apr 15, 2005.

  1. 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
    Dominic Myers, Apr 15, 2005
    #1
    1. Advertising

  2. 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/
    Martin Honnen, Apr 15, 2005
    #2
    1. Advertising

  3. Dominic Myers

    Guest

    I thoroughly recommend the Sarissa library for XmlHttpRequest; it
    provides a browser-independent interface that avoids these sorts of
    problems entirely.

    --Phil.
    , Apr 15, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jmt

    xmlhttpRequest caching problem

    jmt, Jun 27, 2005, in forum: ASP General
    Replies:
    1
    Views:
    198
    Bob Barrows [MVP]
    Jun 27, 2005
  2. gobera

    XMLHttpRequest and Firefox Problem

    gobera, May 3, 2005, in forum: Javascript
    Replies:
    0
    Views:
    79
    gobera
    May 3, 2005
  3. David Wang

    xmlHTTPRequest problem

    David Wang, Sep 12, 2005, in forum: Javascript
    Replies:
    4
    Views:
    86
    David Wang
    Sep 13, 2005
  4. willie
    Replies:
    3
    Views:
    122
    Martin Honnen
    Sep 24, 2005
  5. Greg
    Replies:
    37
    Views:
    374
Loading...

Share This Page