Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML HTTP Request

Status
Not open for further replies.

Tim8w

Programmer
Apr 8, 2003
44
US
I am using JavaScript and XML to retrieve weather data from weather.com. The script works fine when I run it from a local PC, but when I upload it to my ISP, it doesn't work. They are of little help. Here's the code:


try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
alert(xmlhttp);
}
catch (E)
{
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
xmlhttp.open("GET", "
The code fails to create an object with either of the following two lines:

xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
OR
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

and generates a Permission Denied error when it gets to:

xmlhttp = new XMLHttpRequest();

My ISP tells me that I must use:

xmlhttp = new ActiveXObject("Msxml2.ServerXMLHTTP");

but this also fails.

Any ideas?

Thanks,
Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top