|    
 PHP beginner
 |  | Na wat puzzelen in javascript, kwam ik op 't volgende: 
 In de header van je hoofdpagina:
 
 
    
    
        
            
                <? // deze regel fungeert enkel als highlight
<script type="text/javascript" >
	<!--
	var nieuw = '';
	
	function popUp(url, width, height) {
		var winl = (screen.width - width)/2;
		var wint = (screen.height - height)/2; 
		
		if(!nieuw.closed && nieuw.location)
			nieuw.location.href = url;
		else {
			nieuw = window.open(url,'popup','toolbar=no, location=no, scrollbars=yes, width='+width+', height='+height+', left='+winl+', top='+wint+', resizable=no');
			if(!nieuw.opener) nieuw.opener = self;
		}
		if(window.focus) nieuw.focus();
		return false;
	}
	//-->
	</script> <? // deze regel fungeert enkel als highlight<script type="text/javascript" >	<!--	var nieuw = ''; 	function popUp(url, width, height) {		var winl = (screen.width - width)/2;		var wint = (screen.height - height)/2;  		if(!nieuw.closed && nieuw.location)			nieuw.location.href = url;		else {			nieuw = window.open(url,'popup','toolbar=no, location=no, scrollbars=yes, width='+width+', height='+height+', left='+winl+', top='+wint+', resizable=no');			if(!nieuw.opener) nieuw.opener = self;		}		if(window.focus) nieuw.focus();		return false;	}	//-->	</script>
   
 We spreken de functie popUp(); aan, via bvb. een link, maar kan ook  na bvb. onsubmit="popUp();". Dat kies je zelf:
 
 In je body:
 
 
    
    
        
            
                
<a href="#" onclick="popUp('popup.html',300,50);">Open popup</a>
 <a href="#" onclick="popUp('popup.html',300,50);">Open popup</a>
   
 Dit is een voorbeeldcode voor de popup:
 
 
 
    
    
        
            
                <? // deze begintekens tellen niet mee, slechts voor highlight
<html>
<head>
	<title>PopUpken</title>
	<script type="text/javascript">
	<!--
	function vernieuw() {
		opener.location.reload();
		window.close();
	}
	//-->
	</script>
</head>
<body bgcolor="#cccccc" onload="setTimeout('vernieuw()',3000);">
<pre>We wachten een drietal seconden...</pre>
</body>
</html> <? // deze begintekens tellen niet mee, slechts voor highlight<html><head>	<title>PopUpken</title>	<script type="text/javascript">	<!--	function vernieuw() {		opener.location.reload();		window.close();	}	//-->	</script></head><body bgcolor="#cccccc" onload="setTimeout('vernieuw()',3000);"> <pre>We wachten een drietal seconden...</pre> </body></html>
   
 Hierbij wacht de popup 3 seconden om het hoofdvenster te refreshen. Maar beter lijkt me om helemaal onderaan je popup-document volgende code in te voeren:
 
 
 
    
    
        
            
                
<script><!-- vernieuw() //--></script> <script><!-- vernieuw() //--></script>
   
 Voorbeeldje vind je hier: http://sitemasters.addow.be/refresh/
 |