• Post Reply Bookmark Topic Watch Topic
  • New Topic

slow java script warning  RSS feed

 
Aniket Kedari
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I am developing an application which displays map using google MAP API.
I am displaying images and labels on the map using LabeledMarker.
Now when number of images are plenty ( say 200 or more) I get a warning message. It says something like "The javascript in this page will make Internet Explorer slow. It may also hang up the machine. Do you want to execute javascript"

Can anybody tell me solution to this problem
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript can not handle large loops with a lot of processing.

It is better to break it up into groups an using a setTimeout to handle the smaller batches. It will allow the browser not to lock up and run the loop. It will be a little slower, but it will run. [Show a loading message to the user and remove it when the loop is done. You could also do some fancy loading bar if needed.]

Eric
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!