R
RAYMOND PISTEY
Hello on my site this is what is happenning
Part 1 - This is what works and prints me output I like from <print> link in
body section
<head>
<script type="text/javascript">
function ClickHereToPrint(){
try{
var oIframe = document.getElementById('ifrmPrint');
var oContent = document.getElementById('divToPrint').innerHTML;
var oDoc = (oIframe.contentWindow || oIframe.contentDocument);
if (oDoc.document) oDoc = oDoc.document;
oDoc.write("<html><head><title>title</title>");
oDoc.write("</head><body onload='this.focus(); this.print();'>");
oDoc.write(oContent + "</body></html>");
oDoc.close();
}
catch(e){
self.print();
}
}
</script>
</head>
<body>
<a onclick="ClickHereToPrint();">Print</a>
<iframe id='ifrmPrint' src='#' style="width:0px; height:0px;"></iframe>
<div id="divToPrint">
content
</div>
</body>
PART 2 - How do I change the file, print menu item to use my part 1 code
window.print?
Thanks
Ray
Part 1 - This is what works and prints me output I like from <print> link in
body section
<head>
<script type="text/javascript">
function ClickHereToPrint(){
try{
var oIframe = document.getElementById('ifrmPrint');
var oContent = document.getElementById('divToPrint').innerHTML;
var oDoc = (oIframe.contentWindow || oIframe.contentDocument);
if (oDoc.document) oDoc = oDoc.document;
oDoc.write("<html><head><title>title</title>");
oDoc.write("</head><body onload='this.focus(); this.print();'>");
oDoc.write(oContent + "</body></html>");
oDoc.close();
}
catch(e){
self.print();
}
}
</script>
</head>
<body>
<a onclick="ClickHereToPrint();">Print</a>
<iframe id='ifrmPrint' src='#' style="width:0px; height:0px;"></iframe>
<div id="divToPrint">
content
</div>
</body>
PART 2 - How do I change the file, print menu item to use my part 1 code
window.print?
Thanks
Ray