<script>
var data = ["luna maya","lady gaga","aura kasih",
function show(){
i++;
show();
</script>
var data = ["luna maya","lady gaga","aura kasih",
"bill gates","steve jobs"];
var i = 0;
function show(){
alert(data[i]);
setTimeout("show()",2000);
i++;
if(i>=data.length){
i = 0;
}
}
show();
</script>
If there are some parameters, use this:
<script>
</script>
function show(code,desc){
alert(code+': '+desc);
setTimeout(function(){show(code,desc);}, 2000);
}
show(12,'holla world');
</script>
No comments:
Post a Comment