title: why is firefox throwing the error google.maps.geocoder is not a constructor?
body: <p>I have recently began testing my JavaScript in Firefox, originally I was working in chrome.</p>
  
  <p>This section of code works fine in chrome:</p>
  
  <pre><code>geocoder = new google.maps.Geocoder();
  </code></pre>
  
  <p>however the above error is thrown in Firefox, why is that? are there any extra considerations required for Firefox?</p>
  
  <p>Below is my JS and aspx code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var map;
  var placesService;
  var geocoder;
  
  
  function loadMap() {
  
      $("#map-canvas").ready(function () {
          alert("ready");
  
          geocoder = new google.maps.Geocoder();
          alert("1");
  
          map = new google.maps.Map(document.getElementById('map-canvas'),
              {
                  center: new google.maps.LatLng(-34.397, 150.644),
                  zoom: 12
              });
          alert("2");
  
          placesService = new google.maps.places.PlacesService(map);
          alert("3");
  
          $('#control').hide();
          $('#errorLog').hide(); // the error log text box would cause the map to only display half the tiles, delaying the showing of these elements stopped that.
          alert("4");
  
          google.maps.event.addListenerOnce(map, 'tilesloaded', function () {
              alert("5");
              map.controls[google.maps.ControlPosition.TOP_LEFT].push(document.getElementById("control"));
              map.controls[google.maps.ControlPosition.RIGHT].push(document.getElementById("errorLog"));
              $('#control').show();
              $('#errorLog').show();
              alert("6");
          });
  
          alert("7");
  
  
  
  
          $('#locateTown').click(function () { locateTown(); });
          $('#scanTown').click(function () { scanTownStart(); });
          $('#newSearch').click(function () { backToSearch() });
          $('.scanTown').hide();
          $('.info').hide();
          alert("8");
  
      })
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  
  &lt;html lang="en"&gt;
      &lt;head runat="server"&gt;
          &lt;meta charset="utf-8" /&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/&gt;
          &lt;title&gt;Title&lt;/title&gt;
  
          &lt;asp:PlaceHolder runat="server"&gt;
              &lt;%: Scripts.Render("~/bundles/modernizr") %&gt;
          &lt;/asp:PlaceHolder&gt;
  
          &lt;webopt:bundlereference runat="server" path="~/Content/css" /&gt;
          &lt;link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
          
          &lt;form runat="server"&gt;
              &lt;asp:ScriptManager runat="server" EnablePartialRendering="true"&gt;
                  &lt;Scripts&gt;
                      &lt;%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=301884 --%&gt;
                      &lt;%--Framework Scripts--%&gt;
                      &lt;asp:ScriptReference Name="MsAjaxBundle" /&gt;
                      &lt;asp:ScriptReference Name="jquery" /&gt;
                      &lt;asp:ScriptReference Name="respond" /&gt;
                      &lt;asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" /&gt;
                      &lt;asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" /&gt;
                      &lt;asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" /&gt;
                      &lt;asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" /&gt;
                      &lt;asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" /&gt;
                      &lt;asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" /&gt;
                      &lt;asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" /&gt;
                      &lt;asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" /&gt;
                      &lt;asp:ScriptReference Name="WebFormsBundle" /&gt;
                      &lt;%--Site Scripts--%&gt;
                      &lt;asp:ScriptReference Path="~/bundles/Page" /&gt;
                      &lt;asp:ScriptReference Path="~/bundles/Utils" /&gt;
                      &lt;asp:ScriptReference Path="https://maps.googleapis.com/maps/api/js?key=AIzaSyDjcLgEOEkdQfwxEyGOu4hHlSY_s-LOGkQ" /&gt;
                      &lt;asp:ScriptReference Path="https://maps.googleapis.com/maps/api/js?libraries=places" /&gt;
                  &lt;/Scripts&gt;
              &lt;/asp:ScriptManager&gt;
  
              &lt;div class="fill flex-container flex-column"&gt;
                  &lt;asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="always"&gt;
                      &lt;Triggers&gt;
                          &lt;asp:AsyncPostBackTrigger ControlID="uploadResults" EventName="Click" /&gt;
                      &lt;/Triggers&gt;
                      &lt;ContentTemplate&gt;
                          &lt;div id="control" style="margin-top:0.3%"&gt;
                              &lt;input type="text" id="towntoSearch" class="locateTown" value="Hatfield" /&gt;
                              &lt;input type="button" id="locateTown" class="locateTown" value="Locate Town" /&gt;
                              &lt;select id="selectedTown" class="scanTown" &gt;&lt;/select&gt; 
                              &lt;input type="button" id="scanTown" class="scanTown" value="Scan Town" /&gt;
                              &lt;input type="button" id="newSearch" class="scanTown" value="Search Again" /&gt;
                              &lt;input type="text" readonly id="infoDisplay" class="info" /&gt;
                              &lt;asp:Button runat="server" ID="uploadResults" OnClick="uploadResults_Click" ClientIDMode="Static" Text="Upload" CssClass="hidden" /&gt;
                          &lt;/div&gt;
                          &lt;div id="errorLog" style="margin-top:0.3%; margin-right:0.3%"&gt;
                              &lt;textarea cols="20" rows="25" id="errorText"&gt;&lt;/textarea&gt;
                          &lt;/div&gt;
                      &lt;/ContentTemplate&gt;
                  &lt;/asp:UpdatePanel&gt;
  
                  &lt;div class="flex-1" id="map-canvas"&gt;MAP&lt;/div&gt;
      
  
      
              &lt;/div&gt;
  
  
  
          &lt;/form&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>