In Google Chrome I get a failed to load resource when I try to instantiate a xmlHttpRequest object.
In FireFox nothing shows in FireBug.

The code is:

function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
//document.getElementById("_receivedMsgLabel").innerHTML += "Non-microsoft xmlHttpRequest object created.<br/>";
alert("Non-microsoft xmlHttpRequest object created.");
return new XMLHttpRequest();
}
else if (window.ActiveXObject) {
//document.getElementById("_receivedMsgLabel").innerHTML += "Microsoft xmlHttpRequest object created.<br/>";
alert("Microsoft xmlHttpRequest object created.");
return new ActiveXObject("Microsoft.XMLHTTP");
}
else {
alert("Status: Could not create XmlHttpRequest Object. Consider upgrading your browser.");
//document.getElementById("_receivedMsgLabel").innerHTML += "Status: Could not create XmlHttpRequest Object. Consider upgrading your browser.<br/>";
}
}

var sendReq = getXmlHttpRequestObject();
var receiveReq = getXmlHttpRequestObject();
var lastMessage;
var mTimer;

//Gets the server response:
function getResponse() {
document.getElementById("_receivedMsgLabel").innerHTML += "getResponse() called.<br/>";
if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
//if (receiveReq.readyState == 0) {
//receiveReq.open("POST", 'http://tardis:1802', true, "server", "server123");
//receiveReq.open("POST", 'http://localhost:1802', true, "server", "server123");
//receiveReq.open("POST", 'http://holit109:1802', true, "server", "server123");
//receiveReq.open("POST", "http://localhost:1802", true, "server", "server123");
receiveReq.open("POST", "http://L45723:1802", true, "server", "server123"); //must use this URL at work.
receiveReq.onreadystatechange = handleReceiveMessage;
receiveReq.setRequestHeader("Content-Type", "text/x-json");
receiveReq.timeout = 0;
var currentDate = new Date();
var sendMessage = JSON.stringify({
SendTimestamp: currentDate,
Message: "Message 1"
});
//receiveReq.send("<?xml version='1.0'?><Request><Command>Queue</Command><User>user1</User><Message>Message 1</Message><Message>Message 2</Message><Message>Message 3</Message></Request>");
receiveReq.send(sendMessage);

}
}

//function for handling the return message from Comet
function handleReceiveMessage() {
if (receiveReq.readyState == 4) {
document.getElementById("_receivedMsgLabel").innerHTML += "Message received!<br/>";
var status = receiveReq.status;
//document.getElementById("_receivedMsgLabel").innerHTML += "Status received!<br/>";
var txt = receiveReq.responseText;
var receivedMsg = JSON.parse(txt);
document.getElementById("_receivedMsgLabel").innerHTML += receivedMsg.Message + "<br/>";
//var receivedTime = new Date();
//alert("Got current date.");
//alert(receivedTime);
//var receivedTime_ms = receivedTime.getTime();
//alert("Got time message received in ms.");
//alert(receiveReq.SendTimestamp);
//var sentTime_ms = getDateFromFormat(receiveReq.SendTimestamp, "dd/MM/yyyy HH:mm:ss");
//var sentTime = new Date(receiveReq.SendTimestamp);
//alert("Got time message sent in ms.");
//var sentTime_ms = sentTime.getTime();
//var difference_ms = receivedTime_ms - sentTime_ms;
//document.getElementById("_receivedMsgLabel").innerHTML += "Comet took " + difference_ms + " ms.<br/>";

mTimer = setTimeout("getResponse();", 0);
}

getResponse();
}