“Access is denied” error on accessing iframe docum

2019-01-13 15:47发布

For posting AJAX forms in a form with many parameters, I am using a solution of creating an iframe, posting the form to it by POST, and then accessing the iframe's content. specifically, I am accessing the content like this:

$("some_iframe_id").get(0).contentWindow.document

I tested it and it worked.

On some of the pages, I started getting an "Access is denied" error. As far as I know, this shouldn't happen if the iframe is served from the same domain.

I'm pretty sure it was working before. Anybody have a clue?

If I'm not being clear enough: I'm posting to the same domain. So this is not a cross-domain request. I am testing on IE only.

P.S. I can't use simple ajax POST queries (don't ask...)

7条回答
放我归山
2楼-- · 2019-01-13 16:34

My issue was the X-Frame-Options HTTP header. My Apache configuration has it set to:

Header always append X-Frame-Options DENY

Removing it allowed it to work. Specifically in my case I was using iframe transport for jQuery with the jQuery file upload plugin to upload files in IE 9 and IE 10.

查看更多
登录 后发表回答