locked
Newbie question. Hope right forum RRS feed

  • Question

  • Team-

    Trying this again.  Sorry if this is a double post. 
    I have copied the html below directly from the interactive Bing Maps SDK.  I have deleted my credentials.  I pated the code into the default.htm file of a new javascript project in Windows 8 VS 11.  When I double click the default.htm file in the windows explorer, it opens IE with the map as expected.  However, when I debug the project in VS11, I get the error message below. 

    Can someone tell me why it behaves differently under the debugger? 

    THanks in advance!

    --- Error ---


    JavaScript runtime error: 'VEMap' is undefined
    File: ms-wwa://89bb7084-772e-4282-b136-6fc29c084bfe-jp9dqj3fntamg/default.html, line: 12 column: 15 JavaScript runtime error: Unable to get value of the property 'LoadMap': object is null or undefined
    File: ms-wwa://89bb7084-772e-4282-b136-6fc29c084bfe-jp9dqj3fntamg/default.html, line: 13 column: 15

    --- HTML

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
       <head>
          <title>Map with valid credentials</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">
              var map = null;

              function getMap() {
                  map = new Microsoft.Maps.Map(document.getElementById('myMap'), { credentials: '' });
              }
    </script>
       </head>
       <body onload="getMap();">
          <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
       </body>
    </html>

    • Moved by lucy-liu Wednesday, October 26, 2011 7:19 AM it is not related to vs editor (From:Visual Studio Editor)
    Tuesday, October 18, 2011 4:32 PM

Answers

All replies

  • Hi PasadenaJacket,

    The following links tell about how to fix JaveScript runtime error.

    Quote:

    To resolve this issue, upgrade to Microsoft Internet Explorer version 4.01. For information about how to install Internet Explorer 4.01, please see the following article in the Microsoft Knowledge Base:

    170993 (http://support.microsoft.com/kb/170993/EN-US/ ) How to Install Internet Explorer 4.0

    Or, download the latest scripting engine for Windows from the following Microsoft Web site:

    http://www.microsoft.com/scripting

    More information: Error Message: Microsoft JScript Runtime Error: http://support.microsoft.com/kb/178251

    Microsoft JScript runtime error: Unable to get value of the property 'firstChild': object is null...

    http://www.microsoft.com/scripting

    If you still have any further concern about this issue, please write a new post to ASP.NET forum http://forums.asp.net/  for a better support. And please mark the useful reply as answer.

    Thank you for your understanding !

    Best regards,

    Lucy


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, October 20, 2011 5:24 AM
  • Emmm, are you sure?  Internet Explorer 4?  I mean, because I'm already on IE 10 Developer Preview.
    Thursday, October 20, 2011 5:07 PM
  • Hi PasadenaJacket,

    Please try to uninstall your IE 10, and then try to install the lastest IE version. See whether it is helpful.

    In addition, if you want to get a better reply , I recommend you write a new post to ASP.NET forum. This issue is off-topic here.

    Thank you for your understanding!

     

    Best regards,

    Lucy


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, October 21, 2011 5:16 AM
  • Lucy-

    I'm not writing asp.net code.  I have a javascript file that I copied verbatim from Listing 1 at

    http://msdn.microsoft.com/en-us/library/cc316942.aspx

    This sample code runs fine in my Internet Explorer.  However, I am trying to run it in the debugger of Visual Studio, and it is not running.  I don't know where this best forum to post this question, but I can't understand how it would be the asp.net forum, since I am not writing asp.net code.

    David

    Saturday, October 22, 2011 11:23 AM
  • Hi PasandenaJacket,

    The ASP.NET forum contain a part named HTML, CSS and JavaScript which is a place for client-side programming discussions, including CSS, DHTML, Javascript, etc.

     

    Best regards,

    Lucy


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, October 25, 2011 6:23 AM
  • Lucy-

    I'm not writing asp.net code.  I have a javascript file that I copied verbatim from Listing 1 at

    http://msdn.microsoft.com/en-us/library/cc316942.aspx

    This sample code runs fine in my Internet Explorer.  However, I am trying to run it in the debugger of Visual Studio, and it is not running.  I don't know where this best forum to post this question, but I can't understand how it would be the asp.net forum, since I am not writing asp.net code.

    David


    Another solution is that I can move this to the appropriate forum. Thanks!
    Ed Price a.k.a User Ed, Microsoft Experience Program Manager (Blog, Twitter, Wiki)
    Wednesday, November 16, 2011 10:23 PM