"Microsoft JScript runtime error: Permission denied"
I’m getting this problem on this line:
_this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
Basically what I’m doing is trying to loop through XML. Everything works fine, but the minute I call document.write(); it gives me this problem.
EDIT: I’m basically trying to achieve this: http://www.w3schools.com/xml/tryit.asp?filename=tryxml_display_table
But in my code, I’m not doing this:
xmlDoc=xmlhttp.responseXML;
I’m loading my XML like this instead (XML from a WCF web service):
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.loadXML(result.xml);
Any help seriously appreciated.
EDIT: Complete code:
function pageLoad() {
ClassRegistrationServices.GetClassRegistrationReport(success, failure);
}
function success(result) {
document.getElementById('txtValueContainer').value = result;
xmlDoc = new ActiveXObject("Microsoft.XMLDom");
xmlDoc.async = false;
xmlDoc.loadXML(result.xml);
var x = xmlDoc.getElementsByTagName("ClassRegistrationReport_Result");
for (i = 0; i < x.length; i++) {
testVar = x[i].getElementsByTagName("Class_Name")[0].childNodes[0].nodeValue;
}
}
document#writeis a HTML specific method as far as I know. You should probably go into detail on what you try to achieve.Link to MDN