How does a comment cause an XML 揂ccess is denied?error in IE

webmasterbeta

New Member
When the html code below is run in IE on the local machine it gives an 揂ccess is denied?error when it tries to load an xml file called Database.xml. It works fine remotely. The error only happens in IE, it runs fine in firefox. (IE ver. 6)

If the <-- saved from?comment in the 2nd line is deleted, the code works fine both locally and remotely. I've tried moving the comment around, but the error happens if it is anywhere before loadXML() is called.

The comment is just leftover code from a mockup, so I don抰 need it. I抦 just curious as to why a comment would cause an error.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0019)http://www.somewebpage.com/ -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Searcher</title>
<script type="text/javascript">
var xmlDoc;
function loadXML()
{
if (window.ActiveXObject) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.load("Database.xml");
test();

} else if (document.implementation && document.implementation.createDocument) {
xmlDoc = document.implementation.createDocument("","",null);
xmlDoc.load("Database.xml");
xmlDoc.onload = test;
} else {
alert("Your browser cannot handle this script");
}
}

function test()
{
alert ("xml loaded successfully")
}
</script>
</head>

<body onload="loadXML()">
</body>
</html>
 
Back
Top