he
ik ben deze code
deze herlaad het online leden.
echter wil ik dezelfde code gebruiken voor het herladen van de topics zodat je niet de pagina hoeft te herladen om nieuwe berichten te bekijken.
alleen ik kan niet 2x dezelfde code gebruiken want dan werkt het niet meer,
iemand die mij hiermee kan helpen zodat dat wel kan?
mvg ,
smiegles
ik ben deze code
<script>
function Ajax(){
var xmlHttp;
try{
xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
}
catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("No AJAX!?");
return false;
}
}
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
document.getElementById(herlaad).innerHTML=xmlHttp.responseText;
setTimeout(Ajax(),10000);
}
}
xmlHttp.open("GET","http://127.0.0.1/forum/online.php?id=[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) &&[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];
}
}[/COLOR]
?>",true);
xmlHttp.send(null);
}
window.onload=function(){
setTimeout(Ajax(),10000);
}
</script> deze herlaad het online leden.
echter wil ik dezelfde code gebruiken voor het herladen van de topics zodat je niet de pagina hoeft te herladen om nieuwe berichten te bekijken.
alleen ik kan niet 2x dezelfde code gebruiken want dan werkt het niet meer,
iemand die mij hiermee kan helpen zodat dat wel kan?
mvg ,
smiegles