Показать сообщение отдельно
  #6 (permalink)  
Старый 20.12.2013, 15:58
Новичок на форуме
Отправить личное сообщение для ANDRUkomod Посмотреть профиль Найти все сообщения от ANDRUkomod
 
Регистрация: 08.09.2013
Сообщений: 9

код на скорую руку могут быть ошибки

Замените эту часть
for (var i=0; i<profilesCount1; i++) {
$.post("vbazy1.php", { id: data.response[i].to_id, to_id: data.response[i].date, from_id: data.response[i].from_id, text: data.response[i].text}, function(data) { 	} );
}


на что-то подобное

function run(data,next,profilesCount1)
{
$.post("vbazy1.php", { id: data.data.response[next].to_id, to_id: data.response[next].date, from_id: data.response[next].from_id, text: data.response[next].text}, function(data) { if( next+1 < profilesCount1 ) run(data,next++,profilesCount1); else document.location.href = "http://www.site.ru";	} );
}
run(data, 0, profilesCount1);
Ответить с цитированием