Brandon.Gilhooly

ReferenceError: HomeButton is not defined

Discussion created by Brandon.Gilhooly on May 14, 2014
Latest reply on May 16, 2014 by timw1984dev
I am learning to code via Javascript Api, very new and a bit stuck.

Pretty simple code, but I don't understand why I am getting the following 2 errors in Firebug:

ReferenceError: HomeButton is not defined
  var homebutton = new HomeButton({


"NetworkError: 404 Not Found - http://js.arcgis.com/3.9/js/esri/dijit/Homebutton.js"






Here is my code. Any assistance or critiquing would be much appreciated:


<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
    <title>Geocoding Widget API for JavaScript | Simple Geocoding</title>
    <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css">
    <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
    <style>
      html, body, #map {
        height:100%;
        width:100%;
        margin:0;
        padding:0;
      }
      #search {
        display: block;
        position: absolute;
        z-index: 2;
        top: 20px;
        left: 74px;
      }
    </style>
    <script src="http://js.arcgis.com/3.9/"></script>
    <script>
  var map;
      require([
        "esri/map", "esri/dijit/Geocoder", "esri/dijit/Scalebar", "esri/dijit/Homebutton", "dojo/parser", "dojo/domReady!"
      ], function(Map, Geocoder, Scalebar, HomeButton, parser)
  
   {
  
   parser.parse();
  
      map = new Map("map",{
          basemap: "streets",
          center:[-104.0,39.430], //long, lat
          zoom: 13
        });

       var geocoder = new Geocoder({
          map: map,
          autoComplete: true,
          arcgisGeocoder: {
            name: "Esri World Geocoder",
            suffix: " San Antonio, TX"
          }
        },"search");
        geocoder.startup();
 
      });
 
     var homebutton = new HomeButton({
  map: map
   },
  "HomeButton");
  home.startup();


   </script>
  </head>
  <body>
    <div id="search"></div>
    <div id="map"></div>
  </body>
</html>

Outcomes