IE 11 error - Access is denied - XMLHttpRequest

前端 未结 2 1689
青春惊慌失措
青春惊慌失措 2021-01-04 20:25

I\'m having a peculiar error with IE11 and ajax. For nearly all the requests I make using the code below, everything is fine, yet when I try use in conjunction with a copy+p

相关标签:
2条回答
  • 2021-01-04 20:44
    setTimeout(function() {
            ajaxRequest('save_mark','save_mark_completed',[60962,1284,5]) 
        }, 1);
    

    This did work for me for the first call after page load but later calls again started to show Access is denied error

    0 讨论(0)
  • 2021-01-04 20:59

    This question appears to be getting a lot of views, so just in case anybody was wondering, I solved this problem by using a setTimeout() on the original AJAX call. E.g:

    setTimeout(function() {
            ajaxRequest('save_mark','save_mark_completed',[60962,1284,5]) 
        }, 1);
    

    I'm assuming it's some kind of bug in IE. Just 1 millisecond was all it needed!

    0 讨论(0)
提交回复
热议问题