sg

Perşembe, Aralık 08, 2005

JavaScript vars question


Got a quick question about this page:
http://www.econym.demon.co.uk/googlemaps/examples/map3.htm

In the source there is a global var set to 0:
var i = 0;

Also in the loop to add markers another i var is declared:
for (var i = 0; i < markers.length; i++) {

I'm not a js expert, so can someone explain to me why i needs to be set
as a global var (I presume to hold the max value reached as a result of
the loop) as well as being declared in the start of the loop.

thanks

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık