I’m trying to open new window and send form data with javascript and jquery-1.8.3.
With Bernhard’s help I succeeded to call a new window with page for print.
(Thank you so much Bernhard. window.open and sending form data not working)
But, window.print() function does not working in IE9! (FF, Chorme do well)
I refreshed the page, then IE9 calls window.print()
Here is source code.
<a href="#" onclick="printPage()">Print this</a>
<script type="text/javascript" src="/common/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function printPage(){
$.post('/common/print.jsp', {view:$("#ctn").html()}).success(function(response){
var oWindow = window.open('', "printWindow", "width=700px,height=800px");
oWindow.document.write(response);
oWindow.print(); // I added this line. But IE9 not working.
});
}
</script>
Is there something I missed?
Try this one:
checkout this:
Using HTTP Headers to Force Standards View in Internet Explorer 8 and AboveYou can also use meta tags to force standards mode. The
X-UA-Compatible meta tagtells Internet Explorer what view mode to use or emulate.By setting this meta tag, you tell IE to use standards mode even if there are comments or an XML declaration above the DOCTYPE.Youdetermine what version of Internet Explorer can best view the page, and then set the meta tags to define that version.More info find here: http://webdesign.about.com/od/internetexplorer/qt/force-compatibility-view-in-ie.htm