Hi,
du kannst das Zeitproblem lösen, indem du in der Funktion
druckversion eine Variable derart setzt, dass du im Druckdokument im
onload-Event testen kannst, ob es sich um eine Druckvorschau handelt.
Beispiel:
Code:
<html>
<head>
<title>JS - window.open</title>
<meta name="author" content="Quaese">
<script type="text/javascript">
<!--
function druckversion(){
druckvorschau=window.open(window.location.href,"Druckvorschau","width=800,height=600");
// Druckvorschau-Flag setzen
druckvorschau.blnDruckvorschau = true;
}
window.onload = function(){
// Falls das Druckvorschau-Flag gesetzt ist -> Navigation ausblenden
if(top.blnDruckvorschau){
document.getElementById('navigation').innerHTML='';
}
}
//-->
</script>
</head>
<body>
<div id="navigation">Navigation</div>
<p id="drucksymbol" class="screen"><a title="Druckversion" onclick="druckversion();">Druckvorschau</a></p><div id="navigation">
<p>
<a href="http://www.test.de/aktuell.htm" target="_top">zurück</a>
<a>zurück</a>
</p>
</div>
</body>
</html>
Ciao
Quaese