I have a function in head, function is -
<script type="text/javascript">
$("#btnPrint").live("click", function () {
var divContents = $("#page-wrap").html();
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html><head><title>DIV Contents</title>');
printWindow.document.write('</head><body>');
printWindow.document.write(divContents);
printWindow.document.write('</body></html>');
printWindow.document.close();
printWindow.print();
});
</script>
problem is part of the above function showing in the body tag and off course web page.
this is the part of js code that showing in web page
'); printWindow.document.close(); printWindow.print(); });
I have test the code in one server look like this -
<script type="text/javascript">
$("#btnPrint").live("click", function () {
var divContents = $("#page-wrap").html();
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html><head><title>DIV Contents</title>');
printWindow.document.write('</head><body>');
printWindow.document.write(divContents);
printWindow.document.write('</body></html>');
printWindow.document.close();
printWindow.print();
});
and another server code looking like this-
<script type="text/javascript">
$("#btnPrint").live("click", function () {
var divContents = $("#page-wrap").html();
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html><head><title>DIV Contents</title>');
printWindow.document.write('</head><body >');
printWindow.document.write(divContents);
printWindow.document.write('<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","licenseKey":"2aa6bb7413","applicationID":"18758918","transactionName":"MlFbYRRZWBdSWkcPWwsbbEcPF1kWV1xBSEQNRA==","queueTime":0,"applicationTime":50,"atts":"HhZYF1xDSxk=","errorBeacon":"bam.nr-data.net","agent":""}
I don't understand what is the problem . Any help greatly appreciated ! thanks .