Nie mam pomyslu jak wywolac 2 funkcje z ajaxem tak zeby wykonala sie jedna i np. po pol sekundy druga
<script type="text/javascript">
function GetXmlHttpObject(){
if (window.XMLHttpRequest)
return new XMLHttpRequest();
else if (window.ActiveXObject)
return new ActiveXObject("Microsoft.XMLHTTP");
return null;
}
function stateChanged1(){
if(xmlhttp.readyState==4){
alert('1');
}
}
function reLoad1(){
var url = "<?php echo APP_WEB_PATH; ?>/mw/mw.php?mw=" + go_to;
xmlhttp=GetXmlHttpObject();
xmlhttp.onreadystatechange=stateChanged1;
xmlhttp.open("GET", url,true);
xmlhttp.send(null);
}
function stateChanged2(){
if(xmlhttp.readyState==4){
alert('1');
}
}
function reLoad2(){
var url = "<?php echo APP_WEB_PATH; ?>/mw/mw.php?mw=" + go_to;
xmlhttp=GetXmlHttpObject();
xmlhttp.onreadystatechange=stateChanged1;
xmlhttp.open("GET", url,true);
xmlhttp.send(null);
}
</script>
No i teraz jak wywolac reload2 po pol sekundy od reload1 tak zeby reload1 mogl sie zdarzyc zaladowac ?