Substitute for onLoad with WebParts Calculating age from unix timestamps in PHP
Mar 07

I’ve got a google maps application on an ASP.NET ajax enabled page through an update panel. I had used setInterval to run a javscript function periodically and update the markers on the map. Over time, I noticed that when the map was updated through ajax while the javascript code was executing, i got the one of the following two errors:

'__e_' is null or not an object
'undefined' is null or not an object

These errors didn’t seem to have any effect, other than a javascript error being noted.

Through debugging, I determined that it was because of GEvent.addListener(), GEvent.clearListeners(), and marker.setImage(). Because I was getting real time updates, it was ok if every once in a while these things didn’t get updated - I could just ignore it and it probably will be updated next round. So, if you simply put these calls in a try/catch block, the errors don’t get generated.

try
{
    marker.setImage(newImagePath);
}
catch(err){} //it's ok to fail here - ignore it.

Good luck!

Leave a Reply

You must be logged in to post a comment.