i am using the following code to recursively call through ajax.
function ajax_pay(i)
{
var opt=document.getElementById("fpayee").options;
payid=opt[i].value;
alert(i);
if(payid==""){return;}
alert(payid);
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("hint").innerHTML=i;
i++;
ajax_pay(i);
}
}
xmlhttp.open("GET","closeup.php?pid="+payid,true);
xmlhttp.send();
}
here fpayee is a combobox and i am initialising the recursion through ajax_pay(0);
But the problem is it runs only for once. please help;