chris: Javascript Aufruf innerhalb des body / Fehler

Beitrag lesen

Hi,

JAVASCRIPT ist für mich noch absolutes Neuland;
trotzdem versuche ich gerade eine liveMap in ein HTML zu bringen.
Dabei macht der IE7 zicken ...

so funktioniert es im FF und IE7:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Test</title>

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

var map = null;

function GetMap(adr) {
  myMap = new VEMap("mapDiv");
  myMap.LoadMap();

StartGeocoding(adr);
 }

function UnloadMap() {
  if (myMap != null) {
   myMap.Dispose();
  }
 }

function StartGeocoding( address ) {
  myMap.Find(null,    // what
  address, // where
  null,    // VEFindType (always VEFindType.Businesses)
  null,    // VEShapeLayer (base by default)
  null,    // start index for results (0 by default)
  null,    // max number of results (default is 10)
  null,    // show results? (default is true)
  null,    // create pushpin for what results? (ignored since what is null)
  null,    // use default disambiguation? (default is true)
  null,    // set best map view? (default is true)
  GeocodeCallback);  // call back function
 }

function GeocodeCallback (shapeLayer, findResults, places, moreResults, errorMsg) {
  if(places == null) {
   alert( (errorMsg == null) ? "There were no results" : errorMsg );
   return;
  }

myMap.SetMapStyle(VEMapStyle.Birdseye);
 }
</script>

</head>

<body>
<div id="mapDiv" style="position:relative;width:600px;height:400px;"></div>
<script type="text/javascript">window.onload = GetMap('MeineStrasse2, 77777 City, DE');</script>
</div>
</body>
</html>

Sobald ich aber ein weiteres <DIV> mit einbinde
bricht der IE7 ab. Der FireFox bringts noch ...

<div id="Container" class="Clearfix">
<div id="mapDiv" style="position:relative;width:600px;height:400px;"></div>
<script type="text/javascript">window.onload = GetMap('MeineStrasse2, 77777 City, DE');</script>
</div>
</div>

Kann mir bitte jemand helfen. Danke.
grz. Chris