SCRIPT5: access denied in IE9 for iframe in the same domain

I am trying to submit a form with a file attached using an iframe (via AJAX). I use rails and remotipart gem. in fact, I also tried the jquery.form.js library, but no luck. when I submit the form, I get "SCRIPT5: access denied" only in IE9, and when I get redirected to the page from my gmail account. It works fine when I go to my site and submit the form with the attached file, but it does not work when I go to the site using the link from gmail (for other letters it works). I checked how this works - it creates a hidden iframe set form.target = iframe.name (iframe name) and iframe.src = javascript: false; When the form is submitted, it throws an exception = "SCRIPT5: access denied". I tried to set iframe.domain = my siteโ€™s domain, but it didnโ€™t work - iframe = $ (""); btw, I submit the form to the same domain

Has anyone solved this problem?

+7
source share
3 answers

I don't know anything about jQuery, but this is a common JavaScript error. IE does not allow submission of forms with attachments from a script. If you, however, place the form in a separate file and load it into an iframe, frame.form.submit () will work.

+1
source

I suggest you use the latest jQuery (> jquery-1.8.0). Starting with version 1.8.0, they resolved somes of IE9 errors whose error was this.

http://blog.jquery.com/2012/08/30/jquery-1-8-1-released/

0
source

I had the same problem. I used the same versions as in the example. The example worked, but I was not able to get it to work in my application.

I am using Backbone, and I think it has to do with creating the form dynamically, but unfortunately I did not have time to debug the exact problem.

I moved to https://github.com/blueimp/jQuery-File-Upload and it works now.

0
source

All Articles