we added a little .js to provide an easy printout function on our clients new website. as far as i can see its used by many other websites and works like a charm. unfortunatly the -head- part is overwritten by milonics .js.
the -link rel- for the print.css does not appear in the source of the opened window but instead the milonics license protection does:
Code: Select all
<head><style>.milonic{width:1px;visibility:hidden;position:absolute}</style></head>
we are using Version 5.746 and this is the code for the printSpecial:
Code: Select all
function printSpecial()
{
//alert("JS gefunden");
if (document.getElementById != null)
{
var html = '<HTML>\n<HEAD>\n';
if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName("head");
if (headTags.length > 0)
html += headTags[0].innerHTML;
}
html += '\n<link rel=\"stylesheet\" type=\"text/css\" href=\"hilPRINT.css\">';
html += '\n</HE' + 'AD>\n<BODY>\n';
var printReadyElem = document.getElementById("printReady");
if (printReadyElem != null)
{
html += printReadyElem.innerHTML;
}
else
{
alert("Could not find the printReady section in the HTML");
return;
}
html += '\n</BO' + 'DY>\n</HT' + 'ML>';
var printWin = window.open("","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("Sorry, the print ready feature is only available in modern browsers.");
}
}
thanks in advance and please forgive any mistakes as english is not my native language
Beon