<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
var data = ["one","two","three","four"];
function alert_one_second(i){
alert(data[i++%4]);
setTimeout(function(i){
return function(){
alert_one_second(i);
}
}(i),1000);
}
alert_one_second(0);
</script>
</head>
<body>
</body>
</html>