当我尝试检索xml文件时,浏览器(IE8)中的访问被拒绝 [英] access denied in browser (IE8) when I try to retrive xml file

查看:127
本文介绍了当我尝试检索xml文件时,浏览器(IE8)中的访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下内容

<script type="text/javascript">
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
  }
xmlhttp.open("GET","test.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML; 

然后文件继续包含其他内容...问题是我在xmlhttp.open的行上收到一条错误,该错误在IE 8中显示访问被拒绝". 我在本地运行所有这些文件,并且所有这些文件都在同一个文件夹中...我该怎么办才能消除此错误?我用谷歌搜索了一下,似乎错误仍然存​​在.有什么想法吗?

And then the file continues with other stuff... The problem is that I get an error on the line with xmlhttp.open which says Access Denied in IE 8. I run all this files locally and all of them are in the same folder... what can I do to get rid of this error? I googled it a little bit and it seems that the error remains. Any ideas?

推荐答案

虽然不确定,但很可能是跨域的问题.即xmlparsing需要将xml和相应的文件上载到somje本地服务器中.尝试使用 Tomcat

Am not sure but most probably the issue may be because of the cross domain. I.e xmlparsing needs the xml and corresponding files to be uploaded in somje local server. Try using Tomcat or Wamp and call from the server using "http://localhost/appname". hope it works

这篇关于当我尝试检索xml文件时,浏览器(IE8)中的访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆