IE权限被拒绝 [英] IE permission denied

查看:117
本文介绍了IE权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IE上获得权限被拒绝错误(firefox工作正常)

I am getting permission denied error on IE (firefox it works fine)

我正在进行ajax调用(本地域)以及我分配的调用结果到一个div。在调试时,我发现ajax调用没有问题,变量'result'有结果数据。将数据分配给div时会引发错误。

I am making an ajax call (local domain) and result of the call I am assigning to a div. On debugging I came to know there is no issue with ajax call and variable 'result' has the result data. Error is thrown when data is being assigned to div.

错误行:2 jquery-1.8.1.min.js错误:权限被拒绝

Error Line: 2 jquery-1.8.1.min.js Error: Permission denied

Javascript代码:

$.get('administration.htm', function (result) {
    $('#adminDiv').find('#content').html(result);
});

知道为什么会出现这个错误。

Any idea why this error is coming.

推荐答案

权限被拒绝错误可能来自于在文档准备好之前尝试操作DOM。

The permission denied error could be coming from trying to manipulate the DOM before the document is ready.

至于事件和格式不再有效,使用JavaScript和jquery选择事物可能会导致问题。当您使用 document.getElementById 时,它将更新DOM和呈现的页面,但它不会更新关联的jQuery对象。要解决此问题,您需要重新生成jQuery对象(使用 $('selector'))并重新附加处理程序或尝试类似 $的内容(document.getElementById('objectId'))。html('result'); 您使用javascript查找DOM元素以避免权限错误,然后使用关联的jQuery对象修改它。

As for the events and formatting no longer working, using JavaScript and jquery to select things can cause issues. When you use document.getElementById it will update the DOM and the rendered page but it will not update the associated jQuery objects. To solve this you either need to re-generate the jQuery object (using $('selector')) and reattach the handlers or try something like $(document.getElementById('objectId')).html('result'); where you use javascript to find the DOM element to avoid the permission error then modify it using the associated jQuery object.

这篇关于IE权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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