How to overcome this security issue

后端 未结 7 1881
傲寒
傲寒 2020-12-28 15:05

I have implemented an ajax-polling script that calls an action in the server Controller every 10 seconds. With the response, I replace the content of a div:

7条回答
  •  渐次进展
    2020-12-28 15:45

    You should never see that dialog on an Internet-Zone page. By default, this operation is silently and automatically blocked in the Internet Zone.

    There are two root causes for that dialog to appear in the Intranet zone:

    1> Attempting to do a cross-origin request using the XMLHTTPRequest object (http://blogs.msdn.com/b/ieinternals/archive/2011/04/22/ie-security-prompt-page-accessing-cross-domain-information-not-under-its-control.aspx)

    2> Attempting to navigate an OBJECT Tag hosting HTML to a cross origin page.

    You can avoid case #1 by using XDomainRequest instead of XMLHTTPRequest. You can avoid case #2 by using an IFRAME instead of an OBJECT tag.

提交回复
热议问题