Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaScript getElementById get to the second DIV
    primarykey
    data
    text
    <p>why can't I display Google map the the second DIV ID? I tried to change my Map_canvas to Class same results I want to display Google map in he second DIv map_canvas the Map runs on my jQueryMobile so I need to get to the second Div in the display page</p> <p>here is my code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Map&lt;/title&gt; &lt;script src="../../Scripts/jquery-1.8.2.js"&gt;&lt;/script&gt; &lt;script src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; &lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function () { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(success); } else { error('Geo Location is not supported'); } }); function success(position) { debugger; var coords = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); var options = { zoom: 17, center: coords, mapTypeControl: false, navigationControlOptions: { style: google.maps.NavigationControlStyle.SMALL }, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("my_maps").children[0], options); var marker = new google.maps.Marker({ position: coords, map: map, title: "You are here!" }); } &lt;/script&gt; &lt;style&gt; html { height: 100%; overflow: hidden; } body { margin: 0; padding: 0; height: 100%; } #map_canvas { height: 100%; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="my_maps"&gt; &lt;div id="map_canvas"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload