Hi there
I would like to refresh the content of two different divs with two xml feeds.
Then, I call a javascript function in each div to refresh their content:
<div id="1"><script type="text/javascript">
loadrssfeed(1,'feed.xml');
</script></div>
<div id="2"><script type="text/javascript">
loadrssfeed(2,'feed.xml');
</script></div>
The thing is if I only let the first div in the code, the results appear but if I add the second div, there is no result in both divs.
Here here the detail of loadrssfeed function and of the function that sends the request to the server. It's as if this function couldn't deal with multiple call... Thanks in advance for your help
<script type="text/javascript">
function loadrssfeed(div_id, feed){
document.getElementById(div_id).innerHTML= 'chargement en cours...';
http.open('get','form-rss.php?id='+div_id+'&rss='+feed);
http.onreadystatechange = handleResponse(div_id);
http.send(null);
}
function handleResponse(div_id) {
if(http.readyState == 4){
var response = http.responseText;
var update = new Array();
if(response.indexOf('|' != -1)) {
update = response.split('|');
document.getElementById(div_id).innerHTML = update[1];
}
}
}
</script>
Thanks