View Full Version : XMLHttpRequest() and ActiveXObject

04-18-2005, 08: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");


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?

04-18-2005, 09: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

04-19-2005, 05:54 AM