Solution: "An error has occured on the script on this page"

May 26, 2009 at 6:38 PM
Edited May 26, 2009 at 9:42 PM

Out of the blue, I got this error when I started the Virtual Earth Control :

"An error has occured on the script on this page
Expected "}" etc.. Do you wish to continue running scripts on this page ?"

This is because something has changed in the Microsoft Virtual Earth script on their server, and the control is using this. 

Solution:

What you need to do to solve this problem is change the "VirtualEarth.html" file of the control:

Change the line 

 

<script type ="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1&mkt=nl-NL"></script>

to

 

<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>

And the problem is gone.