Well, if that works for one, this should work for two:
Code:
<script type="text/javascript">
function Ajax(url, id){
var $http = null;
if (window.XMLHttpRequest) {
$http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
$http = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {$http = new ActiveXObject('Microsoft.XMLHTTP');} catch(e){$http = null;}
}
}
if ($http) {
$http.onreadystatechange = function(){
if (/4|^complete$/.test($http.readyState)) {
document.getElementById(id).innerHTML = $http.responseText;
}
};
$http.open('GET', url + '?bustcache=' + new Date().getTime(), true);
$http.send(null);
}
}
</script>
<div id="refreshthis"></div>
<div id="refreshthis2"></div>
<script type="text/javascript">
setInterval(function(){Ajax('test.asp', 'refreshthis');}, 5000);
setInterval(function(){Ajax('test2.asp', 'refreshthis2');}, 5000);
</script>
Bookmarks