Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SCRIPT5: Access is denied in IE9 for iframe on the same domain

i am trying to submit form with file attached using iframe(through AJAX). I am using rails & remotipart gem. actually i've tried jquery.form.js library as well, but no luck. when i submit form i am getting "SCRIPT5: access denied" only in IE9 and when i am redirected to the page from my gmail account. It works fine when i go to my site and submit form with file attached, but doesn't work when i go to site through the link from gmail(for other emails it works). i checked how it works - it create hidden iframe set form.target= iframe.name(name of iframe) & iframe.src=javascript:false; When form is submitted it throw exception = "SCRIPT5: access denied". I've tried to set iframe.domain = domain of my site but didn't work - iframe = $(""); btw, i am submitting form to the same domain

Anyone solved this issue ?

like image 507
Dzmitry Avatar asked Jul 14 '12 15:07

Dzmitry


1 Answers

I don't know anything about jQuery, but it is a common javascript error. IE doesn't allow forms with files attached to be submitted from a script. If you however place the form in a seperate file and load it into an iframe, frame.form.submit() will work.

like image 65
Michel Avatar answered Nov 07 '22 23:11

Michel