How to determine print media in jQuery - not CSS

How to determine print media in jQuery - not CSS

I have code that inserts some HTML code and then displays it, if appropriate.

It's something like:

$(document).ready(function() {
$('#foo).prepend('<div class="bar" ......</div><div class="baz" ...</div>');



/* I need a test here to determine whether media is print so that I can skip the following line of code. */

$('.bar').css('display,'block');
});


The default for class .bar is "display:none"; I have a CSS file for print but because I change the display by javascript (jQuery) it doesn't work in this circumstance

TIA, Pete