We are trying to upload a file using a hidden iframe, and the script works in all browsers except IE (9).
- User clicks a link
- Link launches file input to open
- Submit file entry change triggers
- The form is submitted in an iframe
IE9 Developer Tool returns the following error message:
SCRIPT5: Access is denied. jquery-latest.js, line 2977 character 6
Looking around, this seems like an error that occurs next to the jQuery change() event. Honestly, this should be a simple solution ... Thank you very much if you are able to help!
HTML
<form class="hidden" action="index.php?upload" method="POST" id="myForm" enctype="multipart/form-data" target="hidden_iframe"> <input type="file" name="userfile" id="userFile"> <input type="submit"> </form> <iframe id="hidden_iframe" class="hidden" name="hidden_iframe" src="inc/temp.html"></iframe>
Javascript
$('#fake').on("click",function(e){ e.preventDefault(); $('#userFile').click(); return false; }); $('#real').on("change",function(e){ e.preventDefault(); $("#myForm").submit(); });
source share