IE permission denied

2020-07-18 08:36发布

问题:

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

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.

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

Javascript code:

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

Any idea why this error is coming.

回答1:

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

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.