I started viewing the maps of my biking rides on Safari and much to my surprise they didn’t work. I’ve now learned that Apple Safari browser cannot handle large array initialization (this bug has been around since 2004). What is large you ask, large can be as small as an array with 300 elements. If you’ve such an array in your page, you’ll see the Safari’s Slow Script dialog (in my case clicking on the Continue button made no difference — after a few seconds the dialog would get displayed again). The only option is to break the array into smaller arrays (say 150 elements). Here is an example of a page that has a large array (900 or so elements); Firefox can render this page without any problems. Here is an example of the same page where the large array has been broken into 8 separate arrays. This version works on both Safari and Firefox (but not iPhone’s Safari). Perhaps to get this to work on iPhone’s Safari, I’ll have to split the array into smaller chunks.
Safari Large Array Bug
Advertisement