PHP interesse |
|
goedendag,
Ik heb onderstaande code, maar daarmee kan ik enkel 1 div refreshen.. Iemand enig idee hoe ik deze code kan aanpassen zodat er meerdere div's ververst kunnen worden?
Alvast bedankt!
<script type="text/javascript">
var vUri = 'autoupdate.php'
var vRequest;
function getRequest()
{
vRequest = null;
if (window.XMLHttpRequest)
{
vRequest = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
try
{
vRequest = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (err)
{
try
{
vRequest = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (err)
{
return (false);
}
}
}
vRenew = new Date();
vTest = /\?/;
vNewUri = vUri + (vTest.test(vUri)?'&':'?') + 'renew=' + vRenew.getTime();
vRequest.onreadystatechange = catchChange;
vRequest.open('GET', vNewUri, true);
vRequest.send(null);\
}
function catchChange()
{
if (vRequest.readyState == 4 && vRequest.status == 200)
{
document.getElementById('1_reload').innerHTML = vRequest.responseText;
setTimeout('getRequest()', 5000);
}
}
getRequest();
</script>
<script type="text/javascript"> var vUri = 'autoupdate.php' var vRequest; function getRequest() { vRequest = null; if (window.XMLHttpRequest) { vRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { vRequest = new ActiveXObject('Msxml2.XMLHTTP'); } catch (err) { try { vRequest = new ActiveXObject('Microsoft.XMLHTTP'); } catch (err) { return (false); } } } vRenew = new Date(); vTest = /\?/; vNewUri = vUri + (vTest.test(vUri)?'&':'?') + 'renew=' + vRenew.getTime(); vRequest.onreadystatechange = catchChange; vRequest.open('GET', vNewUri, true); vRequest.send(null);\ } function catchChange() { if (vRequest.readyState == 4 && vRequest.status == 200) { document.getElementById('1_reload').innerHTML = vRequest.responseText; setTimeout('getRequest()', 5000); } } getRequest(); </script>
|