var contents = $("#orderdetail").html(); // get the content to print
var frame1 = $('<iframe />');
frame1[0].name = "frame1";
$("body").append(frame1);
var framePrint = frame1[0].contentWindow ? frame1[0].contentWindow : frame1[0].contentDocument.document ? frame1[0].contentDocument.document : frame1[0].contentDocument;
framePrint.document.open();
//Create a new HTML document.
framePrint.document.write('<html><head><title>DIV Contents</title>');
framePrint.document.write('<link href="assets/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />');
framePrint.document.write('<link href="assets/css/print.css" rel="stylesheet" media="print" type="text/css" />'); // class and styles used in content to print
framePrint.document.write('</head><body>');
//Append the external CSS file.
//Append the DIV contents.
framePrint.document.write(contents);
framePrint.document.write('</body></html>');
framePrint.document.close();
setTimeout(function()
{
window.frames["frame1"].focus();
window.frames["frame1"].print();
frame1.remove();
}, 500);This Code depicts how to print popup at client side with external css and with bootstrap.
