gibson18
%Europe/Berlin %719 %2005, 18:15
Wel. Ik denkdat ik al een stukje gevonden heb van mijn probleem. Ik wil dat als de gebruiker een venster sluit er automatisch een nieuwe site wordt opengedaan. Met onderstaande code vraag ik al om bevestiging aan de gebruiker dat hij het venster wil sluiten dus nu zoek ik juist nog waar en hoe ik een nieuwe site kan opendoen.
mvg
gibson
<html>
<head>
<script language="JavaScript"><!--
function confirmIELeave() {
event.returnValue = "Before you go, please turn off the light...";
}
function confirmNSLeave(iWindow) {
if (!document.layers) return;
if (!iWindow.closed){
if (!confirm('Are you sure you want to leave this page?'))
window.location.href = '<a href="http://www.webaddress.com/folder/page">';
}
else window.open(location.href,'newwin');
}
//--></script>
</head>
<body onbeforeunload="confirmIELeave()" onUnload="confirmNSLeave(this)">
<p>Navigate to another page to fire the before unload event. <a href="http://www.netscape.com">go</a>
</body>
</html>
mvg
gibson
<html>
<head>
<script language="JavaScript"><!--
function confirmIELeave() {
event.returnValue = "Before you go, please turn off the light...";
}
function confirmNSLeave(iWindow) {
if (!document.layers) return;
if (!iWindow.closed){
if (!confirm('Are you sure you want to leave this page?'))
window.location.href = '<a href="http://www.webaddress.com/folder/page">';
}
else window.open(location.href,'newwin');
}
//--></script>
</head>
<body onbeforeunload="confirmIELeave()" onUnload="confirmNSLeave(this)">
<p>Navigate to another page to fire the before unload event. <a href="http://www.netscape.com">go</a>
</body>
</html>