...

View Full Version : XMLHttpRequest() and ActiveXObject



kkuntz
04-18-2005, 07:48 PM
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?

brothercake
04-18-2005, 08:43 PM
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

glenngv
04-19-2005, 04:54 AM
http://www.codingforums.com/showthread.php?t=30449



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum