0
$('#show_mess').click(function(){
$('#dropdown_mess').slideToggle("slow");
$('#arrow_mess').slideToggle("slow");
$('#arrow_not').hide("slow");
$('#dropdown_not').hide("slow");
function recall(){ setTimeout(function() {
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "http://localhost/ajax/mess_data.php", true);
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById('dropdown_mess').innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send();
document.getElementById('dropdown_mess').innerHTML = "<img class='non_auto' id='ajax_loading' src='img/ajax_loading.gif'></img>";
recall();
}, 2000);
};
recall();
});
此功能工作正常,但當每個AJAX調用完成我需要colse和爲了工作重新OPER鉻,在FirefoxAjax錯誤只有第一個請求發送
你爲什麼不使用jquery阿賈克斯$功能的更多信息AJAX功能?這是crossbrowser和更方便。 – kasitan
請在您使用HTML的上下文中顯示您的代碼。 – Quentin