appendChild


"microsoft jscript runtime error: unable value of property 'appendchild': object null or undefined"

 

hi folks,

 

this error got when try create new bing map.....

 

 

function getmap() {

            //creating bing map

var map = new microsoft.maps.map(document.getelementbyid("mapdiv"), { credentials: "-xxxxx-", center: new microsoft.maps.location(1.34015994, 103.8119), maptypeid: microsoft.maps.maptypeid.road, zoom: 11 });

 

}

i've played around it....

and read somewhere that, document couldn't "mapdiv" id because script executed before dom loaded.....

 

how deal ??

 

also, i've got map called gothere.sg map...that works 

 

neeeedd heeellpppp...

 

icy.

either move js code bottom of page, or add onload event body tag: <body onload="getmap()">. if else fails check see if mapdiv exists , if doesn't use timeout recall getmap method after few hundred milli seconds.
http://rbrundritt.wordpress.com


Bing Maps  >  Bing Maps Web Controls



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'