A denial of access denial may occur when you try to manipulate the DOM before the document is ready.
For events and formatting that no longer work, using JavaScript and jquery to select things can cause problems. When you use document.getElementById , it will update the DOM and rendered page, but will not update the jQuery related objects. To solve this problem, you need to either regenerate the jQuery object (using $('selector') ) or re-attach the handlers or try something like $(document.getElementById('objectId')).html('result'); where you use javascript to find the DOM element to avoid a permission error, and then change it using the jQuery Object associated with it.
source share