Saturday 15 September 2012

javascript - Print iFrame with jQuery -


I have followed unlimited instances of printing an iframe with jQuery, but whatever I try, it Does not work

I have a page that has a "print" button so that users can print an iframe. So I gave examples and past experiences with jQuery and came on:

  $ ('# printbutton') Click (function () {window.frames ["frameright"].); Window. Frame ["framerate"]. Print ();});   

Accordingly, my iframe

  & lt; Iframe seamless = "seamless" id = "frameright" name = "frameright" src = "url .. .." & gt; & Lt; / Iframe & gt;   

But when I click on the "Print" button, nothing happens

Is anyone enough to push me in the right direction?

There is no need to use jQuery for this.

Simply use:

  function printframe () {window.frames ["frameright"]. Focus (); Window.frames ["frameright"] print () .; }    

No comments:

Post a Comment