[英]Access is Denied on IE11 in AngularJS
每個開發管道都有2個部分。 首先要努力工作並開發應用程序。 第二,努力工作,使其與出色的IE兼容。
我們有一個AngularJS (v1.3.13)
應用程序,沒有在Webstorm
開發任何服務器端代碼。 我們正在進行REST
服務調用。 我們的應用程序在Chrome和Firefox上運行正常,沒有任何控制台錯誤。 但是,當我們嘗試在IE11或IE9中打開頁面(未嘗試IE10)時,我們的頁面無法加載。 控制台提示我們有2個錯誤。 其中之一Access is Denied
xhr.open(method, url, true);
在angular.js
。
互聯網上的帖子數量很多,似乎都沒有作用。 這就是我嘗試過的。
IIS
托管應用程序,以支持.Net v4.0
應用程序池上的跨域調用(由資深人員建議) JSONP
並嘗試將Access-Control-Allow-Origin
(值為*
)添加到標頭中。 錯誤仍然在追逐着我們。 即使是我的同事,也曾在他們的機器上嘗試過相同的操作,但結果卻受到類似的打擊。 有沒有人給我建議呢?
可能是CORS,我可能需要使用xdr(XDomainRequest),但不確定如何使用它,因為angular.js中存在錯誤。 我當然不是專家,所以請提出建議。
錯誤的屏幕截圖:
IE顯示另一個錯誤: [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale
[$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale
[$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale
我現在忽略了。
請給我一些建議。 謝謝。
我從1.3.4切換到1.4.8,就成功了。 IE中不再拒絕Angular Access(Microsoft Edge 25 2015)。 我不知道為什么
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-route.js/1.4.8/angular.min.js"></script>
您是否嘗試過xdomain? https://github.com/jpillora/xdomain,它是純JavaScript CORS替代方案。
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(blob);
}
else {
var objectUrl = URL.createObjectURL(blob);
window.open(objectUrl);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.