I am trying to use XMLHTTP to develop a simple platform independent application. It's a html file that sends a xml search string to a web server, gets returned search results and show the results.
My code to use XMLHTTP:
//send a search key and get back search results
var xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttp.open("POST", url, false);
xmlHttp.setRequestHeader ("MessageType", "Call");
xmlHttp.setRequestHeader ("Content-Type", "text/xml");
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
//display search results using xmlDoc
url: a string of server url, such as http://www.google.com/api
strSearch: a xml string containing a user entered search key
The file works well from my local machine. I can successfully run the file in IIS folder or any other folders of my computer. However, when I upload the file into a remote server, there is always an access deny error. The error message is "Line 64, Error: Access deny". The error line is the first line of my above code. That is to create a XMLHTTP object. I searched W3C and MSN about the use of XMLHTTP, and found that both IE5+ and Netscap6 support the com. I can't figour out what's wrong.
Can anybody help me to make it streight? Thanks in advance.