2007年9月13日星期四

uncaught exception: Permission denied to call method XMLHttpRequest.open

使用Ajax进行请求时得到这样的错误,浏览器为Firefox。
这里有一个解释:
http://www.captain.at/howto-ajax-permission-denied-xmlhttprequest.php
If you want to do cross-domain scripting with XMLHttpRequest, e.g. fetching data from a remote location but you're on a local page or local XUL application (file:///), you need to tell Mozilla/Firefox about that, otherwise you get the infamous error:
Error: uncaught exception: Permission denied to call method XMLHttpRequest.open
意思就是说请求外部的一个url的时候,浏览器需要特别的授权。
xmlHttpRequest is not "allowed" to connect to a different website from the one it is running on.

其它的页面也有一些解决方案,就是将浏览器的安全等级降低。
http://blog.monstuff.com/archives/000262.html

但是这个问题实际上无法解决,如果你就是想请求外部的某个连接返回的地址的话。

没有评论: