AnsweredAssumed Answered

Begginer's Question: I can see the map on the js sandbox but not when I run the html

Question asked by ionarawilson on Jan 16, 2013
Latest reply on Jan 22, 2013 by stevel
I am following the tutorials on how to create a web map using javascript, however when I copy and paste this code from the sandbox to a blank document and save it as html (or I create an html on Aptana) on my computer, and I ran it, the browser is blank. Why is this happening?

This is the link to the tutorial:

http://help.arcgis.com/en/webapi/javascript/arcgis/jstutorials/#intro_agstemplate

Thank you!

And this is supposed to be a live version of the sample in the tutorial.
[HTML]
<!DOCTYPE html>
  <html>
  <head>
  <title>Create a Web Map</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">

  <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/css/esri.css">
  <style>
    html,body,#mapDiv,.map.container{
      padding:0;
      margin:0;
      height:100%;
    }
  </style>

  <script>var dojoConfig = { parseOnLoad:true };</script>
  <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3compact"></script>
  <script>
    dojo.require("esri.map");
    dojo.require("esri.arcgis.utils");

    var map;
 
    function init(){
      var webmapid = "1a40fa5cc1ab4569b79f45444d728067";
      esri.arcgis.utils.createMap(webmapid, "mapDiv").then(function(response){
        map = response.map;
      });
    }

    dojo.ready(init);
  </script>

  </head>

  <body>
    <div id="mapDiv"></div>
  </body>
  </html>
[/HTML]

Outcomes