Daniish
asked on
My site experiences intermittent display problems that can be solved by re-refreshing - Can you help me fix this stability issue?
Hello,
My site is working and generally normally loads without any problems, however, sometimes when i refresh Firebug reports the following error (and none of my markers display):
map.addOverlay is not a function
http://www.globexposure.net/index_new.php
Line 164
If i keep refreshing it will eventually load properly - how can i resolve this?
Cheers
My site is working and generally normally loads without any problems, however, sometimes when i refresh Firebug reports the following error (and none of my markers display):
map.addOverlay is not a function
http://www.globexposure.net/index_new.php
Line 164
If i keep refreshing it will eventually load properly - how can i resolve this?
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
EZFrag,
Just a quick bit of info. Positioning the script as you suggested (right above the body close tag) will run it before the onload event and can still error. I am actually hoping the Asker is doing something like that so I recommended using the body's onload event. That should be "run" after what you had. At least from my experience.
Your suggestions is still good and I am definitely not trying to take from it. I hope the Asker tries both. :) Just wanted to give some info from my experience and knowledge that may even help you. I still remember that method if I need but it always seems to be just before the onload (and sometimes too early).
Thanks for posting and your contribution here and on EE. I hope this helps.
bol
Just a quick bit of info. Positioning the script as you suggested (right above the body close tag) will run it before the onload event and can still error. I am actually hoping the Asker is doing something like that so I recommended using the body's onload event. That should be "run" after what you had. At least from my experience.
Your suggestions is still good and I am definitely not trying to take from it. I hope the Asker tries both. :) Just wanted to give some info from my experience and knowledge that may even help you. I still remember that method if I need but it always seems to be just before the onload (and sometimes too early).
Thanks for posting and your contribution here and on EE. I hope this helps.
bol
I'm glad I could help. Thanks for the grade, the points and the fun question.
bol
bol
It's just like b0lsc0tt said. The chance is that the function is called before the googlemaps API is loaded properly. I would suggest the you take the "onLoad" function from the <body> tag and but it at the bottom above the </body> tag. Same goes for the "getMarkers()" function. Try to put it under the "onLoad()" function. If it still gives the same trouble, try calling "getMarkers()" from "onLoad()". "getMarkers()" should the be the last function called in "onLoad()".
I added a example.
Hope it helps :)
Open in new window