jQuery Plugin - jPrintArea
September 17th, 2007
What is jPrintArea?
jPrintArea is a small jquery plugin to print only contents of a specified element. P.S. This is my first jQuery Plugin
jPrintArea is a small jquery plugin to print only contents of a specified element. P.S. This is my first jQuery Plugin
October 11th, 2007 at 3:45 am
Hello. please can iyou indicate me like to insert this javascript to the code of the portal, since I have to do the link so that it prints? thank you
November 8th, 2007 at 9:44 am
Hey,
this small plugin is great, and just what I was looking for, but there is one problem. It works great on FF, but fail printing on IE. Iframe does get created and is filled with content, but when it comes to printing, it does not print its content. I tried to fix this but failed. Could you please look at it… Thank you…
November 9th, 2007 at 11:13 am
mike, its working fine with ie7 in my laptop. i think you should be using ie6. Anyway, i’ll check and update the script. thanks for leaving your feedback.
January 28th, 2008 at 4:01 pm
Great tool. Thanks but its not working on ie7.
(My browser version: 7.0.5730.13)
But working on firefox. If you cna fix it, it will be great.
January 30th, 2008 at 9:22 am
It’s a great plugin.
But, Is it possible to keep the layout as seen on the browser? Now the printed output has no format. E.g. The border of the table.
Looking forward to your reply. Thank you.
January 31st, 2008 at 5:22 pm
Yes, on IE7, the script print all the page.
February 21st, 2008 at 6:05 am
How can I get rid of the alert box. I tried removing the scipt line (alert(’Printing…’);) but by doing so it stoped working in FireFox and IE6
Thanks,
Will
May 7th, 2008 at 7:05 pm
Hey, its not working for me with firefox.. but works very well with ie7…
Why?
FF doesn’t give any error, its just that when i click nothing happens. It works with IE7.
I just print an image area.
May 7th, 2008 at 9:33 pm
I got it working with firefox and explorer
The problem was that if you remove that line (alert(printing)) it stops working.
Just add this instead of that line:
wait(1);
May 8th, 2008 at 5:50 am
Great script, thanks. Caught some bugs. One of them is - when you’re trying to print a page with several css included, it prints the whole page, not the chosen area. That’s sad, cuz anyway - css do not work here.
Anyway, thanks for the idea!
May 8th, 2008 at 7:33 am
Alex -> you were right will do the changes… i forgot the wait() function… i had to delay the process there thats y i used alert…
May 14th, 2008 at 12:48 pm
Doesn’t work in Opera.
July 31st, 2008 at 8:27 am
hey,
im facing a issue in jprint plugin. mainly after clicking the print link a javascript error is occuring as “Object expected”.
is there any solution to fix that issue?
Yoosuf
http://yoosuf.awardspace.com/
August 25th, 2008 at 10:09 pm
heey !
Ur plug in it’s so good, but i made some change’s on it, because the WAIT() it doesn’t a funcion so, u may have 1 error on Internet Explorer and Mozilla, so this is just what u have to do:
jQuery.jPrintArea=function(el)
{
// First i change the alert for a hidden div with an preloader.
var loader = $j(’printing…‘)
.appendTo(”#message”);
loader.hide();
loader.fadeIn(’slow’);
var iframe=document.createElement(’IFRAME’);
var doc=null;
$j(iframe).attr(’style’,'position:absolute;width:0px;height:0px;left:-500px;top:-500px;’);
document.body.appendChild(iframe);
doc=iframe.contentWindow.document;
var links=window.document.getElementsByTagName(’link’);
for(var i=0;i’);
// then i made a special CSS for my printing. (this is only for a better view).
doc.write(”+$j(el).html()+”);
doc.close();
iframe.contentWindow.focus();
iframe.contentWindow.print();
//Add some Fx’s to make it COOL JEJEJE.
loader.animate({opacity: 1.0}, 6000)
loader.fadeOut(’slow’, function() {
$(this).remove();
});
//Finally this is the best part, with setTimeout u prevent the error message on explorer and mozilla.
setTimeout(”document.body.removeChild(iframe)”,5000);
}
August 25th, 2008 at 10:11 pm
ammmm …
jQuery.jPrintArea=function(el)
{
// First i change the alert for a hidden div with an preloader.
var loader = $j(’printing‘)
.appendTo(”#message”);
loader.hide();
loader.fadeIn(’slow’);
August 25th, 2008 at 10:11 pm
OMG !
asdfasdfghdg
ghj
f
var loader = $j(’Wait‘)
August 25th, 2008 at 10:13 pm
ok
‘printing
inside the :
var loader = $j()