Connecting Tech Pros Worldwide Help | Site Map

IE7 Printing Iframe Solution

  #1  
Old April 9th, 2007, 12:36 PM
Newbie
 
Join Date: Apr 2007
Location: UK
Posts: 1
Dear All,

I was looking for a solution to print Iframes in Internet Explorer 7 (IE7)

the command window.print() ( even with window.focus) in an iframe does not work.

The solution is
<script language=javascipt>

document.execCommand('print', false, null);

</script>

I spent alot wasted time figuring this out, hope it helps!

best regards,

Ariel

I am considering making Goofi.com free, any ideas on a revenue model?
Goofi is a Live Chat for website with Audio and Video to comunicate with consumers before a sale.
  #2  
Old January 2nd, 2008, 04:42 PM
Newbie
 
Join Date: Jan 2008
Posts: 2

re: IE7 Printing Iframe Solution


You are the man!! It works!!
  #3  
Old June 26th, 2009, 11:36 AM
Newbie
 
Join Date: Jun 2009
Posts: 1

re: IE7 Printing Iframe Solution


used it this way:
Expand|Select|Wrap|Line Numbers
  1.         <script type="text/javascript">
  2.             try
  3.             {
  4.                 document.execCommand('print', false, null);
  5.             }
  6.             catch(e)
  7.             {
  8.                 window.print();
  9.             }
  10.         </script>
  11.  
works perfectly, thanks.
Reply