Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XMLHttpRequest() and ActiveXObject

    I have a scipt that uses the ActiveXObject to GET the output of a PHP file on the web server.

    Obviously, this only works for IE, but I need it to work for Mozilla too. All that I've found was to use XMLHttpRequest. I tried that, and nothing happens.

    Example (for the time being):

    var sURL = "query.php";

    if ( navigator.appName == "Netscape" ) {
    var myXML = new XMLHttpRequest();
    } else {
    var myXML = new ActiveXObject("Microsoft.XMLHTTP");
    }

    myXML.Open("GET",sURL,false);
    myXML.send();


    when I run on different browsers, I know it is getting to the right code b/c I debugged with some alert functions.

    This works fine in IE, but for Mozilla, I get nothing. No errors and no data is returned.

    Any ideas?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're missing an argument from the send() method - which is a string for the data you're sending in the request, or null if there isn't any
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •