jQuery form plugin - iframe problem
Here I am, with another problem. :) Maybe this time I'll get some responses. :P I'm using jquery.form.js
plugin, to process forms with file fields. It's simple implementation.
$this.ajaxSubmit({
data: { 'ajax' : 'true' },
dataType: 'html',
success: pa开发者_如何学JAVArseRsp,
error: parseErr
});
It works on Chrome, Opera and new Firefoxes. It doesnt on Firefox 3.x and all versions of IE. Plugin throws some Server abort
problem, but after some changes in code to debug it, I get it. Function getDoc(iframe)
throws Permission denied
in IE. But why? It's not cross-domain or something? I even add <script>document.domain = 'mydomain.com';</script>
but that doesn't work either. Any ideas?
BTW. we are using APE Project. It probably makes some document.domain modifications, but on Chrome console, on page where is form, when I type document.domain i'm still getting mydomain.com
, so...
I had a similar issue just now.
The problem was that I was setting the document.domain
property in the parent document. The api document that is inside the iframe is vanilla json, and, as such, has no opportunity of setting a document.domain
. Hence the permission issue.
So I had to remove the document.domain
assignment from the parent.
精彩评论