var display_setting = "toolbar=yes, location=no, directories=yes, menubar=yes,";
display_setting += "scrollbars=yes, width=750, height=600, left=100, top=25";
var printwin = window.open('', 'printwin', display_setting )
printwin.document.open()
printwin.document.write("Testing")
printwin.document.close()
Why does the above code generate a "Permission Denied" error in IE9, but works perfectly fine on Firefox or Chrome? Is there a work around? It is an ExtJS 4.1 application is running on an intranet from a single domain. It uses the ExtJS history feature which may be a factor.
Thanks
I have tested with the above code, in IE I have found only one issue, that is in the last line you haven't declared the object win... if you give the details of your requirement then I will help. I have modified your code and tried its works fine for me in IE.
Here is the test code. If you want to close the window use printwin.close() instead of printwin.document.close().
<script type="text/javascript">
function openwindowIE(){
var display_setting = "toolbar=yes, location=no, directories=yes, menubar=yes,";
display_setting += "scrollbars=yes, width=750, height=600, left=100, top=25";
var printwin = window.open('', 'printwin', display_setting )
printwin.document.open()
printwin.document.write("Testing")
printwin.document.close()
}
</script>
<input type="button" onclick="openwindowIE()" value="go" />
If I'm not mistaken, IE thinks, that about:blank (which you are trying to open, I guess) is an insecure website and thus you aren't allowed to communicate with it.
If I'm not mistaken, you could open any other (empty) html document and write in it, instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With