Сообщение от kupidon
|
Не понимаю как избавиться от цикла? мне ведь надо обработать массив, чтобы взять оттуда данные для отправки на сервер.
|
Как вариант...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<!--
<script src='http://code.jquery.com/jquery-latest.js'></script>
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
-->
<style type='text/css'>
</style>
<script type='text/javascript'>
var arr=[0,1,2,3,4,5];
var tmo=1000;
function test(){
document.writeln(arr[test.item]);
if (++test.item<arr.length) {
setTimeout(test,tmo);
};
};
test.item=0;
setTimeout(test,tmo);
</script>
</head>
<body>
</body>
</html>