I have download the DHTML modal dialog script source zip from web site, i unzip all the files and folder, and point my IIS server to that folder. When i run the demo-modal-message.html, The static message is working fine, but when i try to loaded message from external files, It get problem to get the URL file?
on the Html file, it has the function
onclick="displayMessage('includes/demo-modal-message-1.inc');return false"
I double check the url page is exist on my server by type "http://localhost/includes/demo-modal-message-1.inc" and it show up correctly.
Then i run the code in debug, i find it get problem in ajax.js , the self.responseStatus[0] = "405"
here is the code inside ajax.js get error
this.runAJAX = function(urlstring) {
if (this.failed) {
this.onFail();
} else {
this.createURLString(urlstring);
if (this.element) {
this.elementObj = document.getElementById(this.element);
}
if (this.xmlhttp) {
var self = this;
if (this.method == "GET") {
totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
this.xmlhttp.open(this.method, totalurlstring, true);
} else {
this.xmlhttp.open(this.method, this.requestFile, true);
try {
this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
} catch (e) { }
}
this.xmlhttp.onreadystatechange = function() {
switch (self.xmlhttp.readyState) {
case 1:
self.onLoading();
break;
case 2:
self.onLoaded();
break;
case 3:
self.onInteractive();
break;
case 4:
self.response = self.xmlhttp.responseText;
self.responseXML = self.xmlhttp.responseXML;
self.responseStatus[0] = self.xmlhttp.status;
self.responseStatus[1] = self.xmlhttp.statusText;
if (self.execute) {
self.runResponse();
}
if (self.elementObj) {
elemNodeName = self.elementObj.nodeName;
elemNodeName.toLowerCase();
if (elemNodeName == "input"
|| elemNodeName == "select"
|| elemNodeName == "option"
|| elemNodeName == "textarea") {
self.elementObj.value = self.response;
} else {
self.elementObj.innerHTML = self.response;
}
}
if (self.responseStatus[0] == "200") {
self.onCompletion();
} else {
self.onError(); }
self.URLString = "";
break;
}
};
this.xmlhttp.send(this.URLString);
}
}
};