Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18772

simple code that I have copied that give error

From "Tony" <tony.johansson@inport.com>
Newsgroups comp.lang.javascript
Subject simple code that I have copied that give error
Date 2013-03-08 11:22 +0100
Organization A noiseless patient Spider
Message-ID <khce33$i5$1@dont-email.me> (permalink)

Show all headers | View raw


This is some pice of code that I have copied.
The copied example says The following code shows a complete Web page that 
loads a map. Valid map types are found in the MapTypeId Enumeration topic.
This example does not work I get error when I try to use it in browser It 
says JavaScript: Microsoft has not been defined so the row that causing the 
problem is this row
new Microsoft.Maps.Map . . as you can see below

What is it that I have missed here ?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

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

      <script type="text/javascript">
          function GetMap()
          {

              var map = new 
Microsoft.Maps.Map(document.getElementById("mapDiv"),
                           { credentials: "Your Bing Maps Key",
                               center: new 
Microsoft.Maps.Location(45.5, -122.5),
                               mapTypeId: Microsoft.Maps.MapTypeId.road,
                               zoom: 7
                           });
          }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='mapDiv' style="position:relative; width:400px; 
height:400px;"></div>
   </body>
</html>

//Tony 

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

simple code that I have copied that give error "Tony" <tony.johansson@inport.com> - 2013-03-08 11:22 +0100
  Re: simple code that I have copied that give error "Tony" <tony.johansson@inport.com> - 2013-03-08 14:24 +0100
    Re: simple code that I have copied that give error Jim T. <x@y.z> - 2013-03-08 09:26 -0500
      Re: simple code that I have copied that give error Stefan Weiss <krewecherl@gmail.com> - 2013-03-08 16:28 +0100

csiph-web