'XMLHttpRequest' is undefined

Dear Gurus,

i have a javascript am trying to run on command prompt but is failing. it is giving me the error “‘XMLHttpRequest’ is undefined”. here below is the sample code

var url="http://localhost/sms?username=u&password=p&from=111&text=test&to=27788988988 ";
function httpGet( the_url ){
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function() { alertContents(httpRequest); };
httpRequest.open(“GET”, the_url, true);

where am i going wrong

You are trying to use JavaScript commands that are only available when it runs in a web page.

If you are testing in old IE versions, it doesn’t support XMLHttpRequest. Instead it supports XDomainRequest for ajax. However, recent IE versions (after 8 I suppose) support both objects.

That’s completely wrong -IE7+ all support XMLHttpRequest.

XDomainRequest was introduced in IE8 as a proprietary way to make cross domain calls. Unless you are trying to access someone else’s server with the call you should use XMLHttpRequest which all current browsers support (in web pages).

I meant XMLHttpRequest Level 2 to be exact.