Click to See Complete Forum and Search --> : Javascript "Access is Denied" error


simon_stocks
09-01-2003, 12:25 PM
I have been trying to get this javascript working for a while now, its an XML parser for a news feed.
Basically, I needed something that would parse the information, so that I could insert that target=_blank statement in the URL, as direct linking to the news source didn't open a new window.

The script is as follows

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript">

var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");

function loadXML(xmlFile) {
xmlDoc.async="false";
xmlDoc.onreadystatechange=verify;
xmlDoc.load(xmlFile);
}

function verify() {
if(xmlDoc.readyState!=4)
return false;
}

function traverse(tree,vars) {
tempVar=vars
//if (tempVar != "") { alert(tempVar) }
if(tree.hasChildNodes()) {
var title = tree.getAttribute("name")
if (title=='Title') { tempVar=tree.text }
if (title=="Description") { document.write(tree.text+'</p>') }
if (title=="Link"){ document.write('<a href="'+tree.text+'" target="_blank">'+tempVar+'</a><br>') }
var nodes=tree.childNodes.length;
for(var i=0; i<tree.childNodes.length; i++)
traverse(tree.childNodes(i), tempVar);
}
}

function initTraverse(file) {
loadXML(file);
var doc=xmlDoc.documentElement;
traverse(doc,'nothing');
}

</script>

<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body onload="initTraverse('http://www.deadbrain.co.uk/synd/syndicate.xml')">

</body>
</html>


--------------------------------------------------------------------

If I run it locally on my machine, it works fine, but as soon as I load it onto the web server, it comes up with the Access is Denied message.

Any help would be greatly appreciated.

Thanks

Simon:confused:

Khalid Ali
09-01-2003, 12:35 PM
I think you wil need to post it directly somewhere on MS site or email them,I have spent few hours on it some time ago,and I could not find a solution for it.

There has to be some way that VBScript could avoid this.