Javascript and php print ready
Posted: Sat May 28, 2005 9:27 am
i have here a code but i cant seem to make this work... can anyone help?
thanks!
it gives me an error "access denied" i dont know where this access denied is...
thanks!
thanks!
it gives me an error "access denied" i dont know where this access denied is...
thanks!
Code: Select all
<script type="e;text/javascript"e;>
<!--
var gAutoPrint = true; // Flag for whether or not to automatically call the print function
function printSpecial()
{
if (document.getElementById != null)
{
var html = '<HTML>\n<HEAD>\n';
if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName("e;head"e;);
if (headTags.length > 0)
html += headTagsї0].innerHTML;
}
html += '\n</HE' + 'AD>\n<BODY>\n';
var printReadyElem = document.getElementById("e;printReady"e;);
if (printReadyElem != null)
{
html += printReadyElem.innerHTML;
}
else
{
alert("e;Could not find the printReady section in the HTML"e;);
return;
}
html += '\n</BO' + 'DY>\n</HT' + 'ML>';
var printWin = window.open("e;"e;,"e;printSpecial"e;);
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("e;Sorry, the print ready feature is only available in modern browsers."e;);
}
}
//-->
</SCRIPT>