In an html program I am using a script (version A) to send some XML data to a server to be processed. This, JavaScript function, posts the XML data to the server. I slightly different script (version B) works flawlessly with IE browser. But, why do I always get "Permission denied call to call method XMLHttpRequest.open" when I run the program with (version A) within a Mozilla browser? Am I doing something incorrectly, or, am I missing something?
.
.
.
. ----------- (version A) -------------
<script language="javascript" type="text/javascript">
function postXML (url, xmlDocument) {
try {
var httpRequest = new XMLHttpRequest();
httpRequest.open("POST", url, false);
httpRequest.send(xmlDocume
nt);
return httpRequest;
}
catch (e) {
alert("(Mozilla) - " + e);
return null;
}
}
</script>
.
.
---------------- (version B) --------------------------
--
function postXML (url, xmlDocument) {
var httpRequest;
try {
httpRequest = new ActiveXObject('Msxml2.XMLH
TTP');
httpRequest.open("POST", url, false);
httpRequest.send(xmlDocume
nt);
return httpRequest;
}
catch (e) {
alert("(IE) - " + e);
return null;
}
Start Free Trial