XMLHttpRequest: problem with IE?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dominic Myers

    #1

    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


  • Martin Honnen

    #2
    Re: XMLHttpRequest: problem with IE?



    Dominic Myers wrote:

    [color=blue]
    > 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.[/color]

    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_vers ion >= 5)
    try {
    httpRequest = new ActiveXObject(' Microsoft.XMLHT TP');
    }
    catch (e) { }
    @end @*/
    }
    return httpRequest;
    }

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

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • phil_gg04@treefic.com

      #3
      Re: XMLHttpRequest: problem with IE?

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

      --Phil.

      Comment

      Working...