jQueryPlugins icon indicating copy to clipboard operation
jQueryPlugins copied to clipboard

PRINT ON IE8 AJAX CONTENT WITH IFRAME METHOD

Open erikzaadi opened this issue 14 years ago • 2 comments

Just noticed this on plugins.jquery.com

Submitted by aiecoucou on May 28, 2010 - 7:54pm

Project: jQuery Print Element

Version: 1.1

Component: Code

Category: bug report

Priority: normal

Assigned: Unassigned

Status: patch (code needs review)

I had some problems to print a content from ajax with iframe method, i found a solution mayby this can help you :

i replaced the line :

html.push('function printPage(){focus();print();' + ((!$.browser.opera && !opts.leaveOpen &&    opts.printMode.toLowerCase() == 'popup') ? 'close();' : '') + '}');

by this line :

html.push('function printPage(){focus();try { document.execCommand(\'print\', false, null); } catch(e) {window.print();}' + ((!$.browser.opera && !opts.leaveOpen && opts.printMode.toLowerCase() == 'popup') ? 'close();' : '') + '}');

it's seems to work for me...

erikzaadi avatar Jan 01 '11 21:01 erikzaadi

I had this exact same issue with version 1.2 , This edit fixed it for me.

cphill02 avatar Oct 04 '11 23:10 cphill02

for reference: http://bytes.com/topic/misc/answers/629926-ie7-printing-iframe-solution

cphill02 avatar Oct 04 '11 23:10 cphill02