You could try the following diagnostic tests:Change alert("foo"); to alert(len); . Does it alert the right value? If you see "6" then you may be victim of persistent caching (an earlier version of your code).
Try running the code within a onload = function(){...} structure. If you still get 6 alerts, then it would appear that the window.onload event fires 6 times.
Remove the loop, leaving len=1; alert(len); . If you still get 6 alerts, then it would appear that the emulator loads the page (or at least the javascript) 6 times.
Airshow
Airshow
WiFi Lounge Lizard
2,682 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372