Nicca
Новичок
div.innerHTML проблемы
Не работает div.innerHTML в первом вызове setTimeout(function(). Почему?
PHP:
lsXmlHttp.onreadystatechange=function() {
var response;
if(lsXmlHttp.readyState==4){
setTimeout(function(){
response = lsXmlHttp.responseText;
if(response=='1') { div.innerHTML=jwajaxvote_lang['THANKS']; }
else
{
div.innerHTML=jwajaxvote_lang['ALREADY_VOTE'];
}
},3000);
setTimeout(function(){
if(response=='1'){
var newtotal = total_count+1;
if(newtotal!=1) div.innerHTML='('+(newtotal)+' '+jwajaxvote_lang['VOTES']+')';
else div.innerHTML='('+(newtotal)+' '+jwajaxvote_lang['VOTE']+')';
var percentage = ((total + i)/(newtotal))*20;
document.getElementById('rating'+id+parent).style.width=percentage+'%';
} else {
if(total_count!=1) div.innerHTML='('+(total_count)+' '+jwajaxvote_lang['VOTES']+')';
else div.innerHTML='('+(total_count)+' '+jwajaxvote_lang['VOTE']+')';
}
},3000);
}
}
lsXmlHttp.open("GET",live_site+"/mambots/content/plugin_jw_ajaxvote/ajax.php?task=vote&user_rating="+i+"&cid="+id+"&parent="+parent,true);
lsXmlHttp.send(null);