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


Groups > comp.lang.javascript > #18772 > unrolled thread

simple code that I have copied that give error

Started by"Tony" <tony.johansson@inport.com>
First post2013-03-08 11:22 +0100
Last post2013-03-08 16:28 +0100
Articles 4 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  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

#18772 — simple code that I have copied that give error

From"Tony" <tony.johansson@inport.com>
Date2013-03-08 11:22 +0100
Subjectsimple code that I have copied that give error
Message-ID<khce33$i5$1@dont-email.me>
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 

[toc] | [next] | [standalone]


#18774

From"Tony" <tony.johansson@inport.com>
Date2013-03-08 14:24 +0100
Message-ID<khcona$jnh$1@dont-email.me>
In reply to#18772
I found the problem. If I use Firefox it works
//Tony

"Tony"  wrote in message news:khce33$i5$1@dont-email.me...

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 

[toc] | [prev] | [next] | [standalone]


#18775

FromJim T. <x@y.z>
Date2013-03-08 09:26 -0500
Message-ID<86tjj8pugi2d4vurl1p6kas605apked28r@4ax.com>
In reply to#18774
On Fri, 8 Mar 2013 14:24:17 +0100, "Tony" <tony.johansson@inport.com>
wrote:

>I found the problem. If I use Firefox it works

I changing browsers fixes the problem, then you really haven't fixed
the problem.

[toc] | [prev] | [next] | [standalone]


#18776

FromStefan Weiss <krewecherl@gmail.com>
Date2013-03-08 16:28 +0100
Message-ID<khd03u$pps$1@news.albasani.net>
In reply to#18775
On 2013-03-08 15:26, Jim T. wrote:
> On Fri, 8 Mar 2013 14:24:17 +0100, "Tony" <tony.johansson@inport.com>
> wrote:
> 
>>I found the problem. If I use Firefox it works
> 
> I changing browsers fixes the problem, then you really haven't fixed
> the problem.

If there even was a problem. I tried his example in Chrome and had no
problems (apart from a missing Microsoft ID). The "Microsoft" identifier
is declared in the included library, so the example should work, as long
as the external library is loaded correctly.

- stefan

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web