• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

slow java script warning

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic