jquery-iframe-transport icon indicating copy to clipboard operation
jquery-iframe-transport copied to clipboard

Script5: Access denied when trying to submit form

Open DzmitryNikitsin opened this issue 13 years ago • 22 comments

This issue appears only in IE9 when user came from gmail link.

DzmitryNikitsin avatar Jul 18 '12 13:07 DzmitryNikitsin

I can confirm that this is an issue even when not coming from a gmail link. There is a script access issue in IE9, period.

voxxit avatar Sep 08 '12 00:09 voxxit

Hrm, I see this issue only for users coming from gmail. Any chances to get it fixed ?

DzmitryNikitsin avatar Sep 08 '12 08:09 DzmitryNikitsin

Can you please provide more details about what you're doing so that I could try to reproduce it?

cmlenz avatar Sep 08 '12 10:09 cmlenz

We are sending email to our users, when user click link from the email he go to the page with popup. Popup has a field for file upload, upload starts only when user submit form. We use rails remotipart gem for async form submit(also i've tried jquery form plugin http://malsup.com/jquery/form/#code-samples, but the same issue). When i submit form i am getting "Script5: Access denied" in jquery.iframe-transport.js this happen only for IE9 and when user come from gmail. if user come from yahoo mail for example and use IE9 it works fine. Let me know if you need more description or you want me to share my screen and show you live example.

DzmitryNikitsin avatar Sep 08 '12 14:09 DzmitryNikitsin

Is there anything cross-domain involved here?

cmlenz avatar Sep 08 '12 14:09 cmlenz

No i am doing all on the same domain.

DzmitryNikitsin avatar Sep 08 '12 15:09 DzmitryNikitsin

This happens on a Facebook page for us. I'm not sure whether the issue happens or not when putting the FQDN/host before the path (i.e. http://blah.com/path instead of just /path), but that may be one thing to look into?

voxxit avatar Sep 10 '12 18:09 voxxit

I've tried http://domain/path and /path - the same issue ;(

DzmitryNikitsin avatar Sep 10 '12 19:09 DzmitryNikitsin

If you are using javascript to trigger a click on a file input, IE will mark that form as insecure and throw this error when you try to submit. Make sure you're letting the browser trigger a native click event on the file input.

More info here

pivotal-redstone avatar Oct 08 '12 17:10 pivotal-redstone

I don't trigger click or file assignment in javascript for input type='file', but still having this issue

DzmitryNikitsin avatar Oct 08 '12 18:10 DzmitryNikitsin

Try making sure your popup has a real path (instead of just injected content). If its path isn't on your domain (and "" isn't on your domain) you will get stopped because of cross domain problems.

pivotal-redstone avatar Oct 09 '12 17:10 pivotal-redstone

IE9 is giving me the error as well. Access is denied. Line 201, character 13, which is form[0].submit(); I'm using the most simple code to test, and the everything is same domain.

$.ajax({
    url        : options.action,
    dataType   : 'json',
    files      : $(file_input),
    iframe     : true
}).complete(function( response ){
    console.log( response );
});

options.actions can be absolute or relative, doesn't make a difference. Working with other browsers, but IE9 is a big deal to support. I'll keep searching around Google and see if anyone else fixed this.

skunkbad avatar Oct 22 '12 05:10 skunkbad

've got the same problem, all browsers are doing OK, all but IE9...

mwagena avatar Oct 26 '12 13:10 mwagena

I get this error too

mdesantis avatar Nov 15 '12 10:11 mdesantis

does this plugin work at all in IE9?

rvalle avatar Feb 11 '13 10:02 rvalle

yes it works for IE 9 fine when you came to page directly or from email other then gmail. It just doesn't work when you came to the page from gmail.

DzmitryNikitsin avatar Feb 11 '13 11:02 DzmitryNikitsin

I managed to reproduce the behavior that you describe: a link that works from icloud but not gmail.

however, gmail is still widely popular.

do you have any idea about the underlying technical issue? Is there any documentation about it?

Workarounds? or at least being able to detect that it is going on.

I have also tested http://blueimp.github.com/jQuery-File-Upload/ which also uses an iframe solution and seems to suffer the same issue.

rvalle avatar Feb 11 '13 16:02 rvalle

When i had the same issue it was indeed because of triggering the click event on the file input. Using the native (and ugly indeed) file input control solved the problem for me!

simonspoerri avatar May 24 '13 14:05 simonspoerri

I too faced the same problem.Problem is triggering the click through javascript. Solution is here.http://jsfiddle.net/rudiedirkx/8hzjP/show/

vsapram avatar Feb 11 '14 10:02 vsapram

@vsapram Can you expand on your solution at all? Stuck in the same place!

PunkChameleon avatar Jan 14 '15 21:01 PunkChameleon

This is killing me at the moment. Is it possible for someone to sum up any solutions they found? Would really appreciate it forever!

PunkChameleon avatar Jan 15 '15 14:01 PunkChameleon

Could it be if the site is hosted with SSL?

jeroenherczeg avatar Dec 01 '15 16:12 jeroenherczeg