How do I print an IFrame from javascript in Safari/Chrome

Posted by Andrew Bullock on Stack Overflow See other posts from Stack Overflow or by Andrew Bullock
Published on 2009-01-23T13:53:08Z Indexed on 2010/05/26 16:11 UTC
Read the original article Hit count: 628

Filed under:
|
|
|

Hi,

Can someone please help me out with printing the contents of an IFrame via a javascript call in Safari/Chrome.

This works in firefox:

$('#' + id)[0].focus();
$('#' + id)[0].contentWindow.print();

this works in IE:

window.frames[id].focus();
window.frames[id].print();

But I can't get anything to work in Safari/Chrome.

Thanks

Andrew

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about iframe