ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.[Solved] Google API: User current location using JavaScript not displaying<blockquote><cite>nauna says:</cite> <pre><code class="js plain">&lt;script type=</code><code class="js string">"text/javascript"</code> <code class="js plain">src=</code><code class="js string">"<a href="https://maps.googleapis.com/maps/api/js?sensor=false">https://maps.googleapis.com/maps/api/js?sensor=false</a>"</code><code class="js plain">&gt;&lt;/script&gt;</code></pre> </blockquote> <p>You are not passing the API Key. You need to add the&nbsp;API Key in the url.</p> <pre class="brush: html">&lt;script type=&#34;text/javascript&#34; src=&#34;https://maps.googleapis.com/maps/api/js?&amp;key=AIzaSyBE1J5Pe_GZXBR_x9TXOv6TU5vtCSmEPW4&#34;&gt;&lt;/script&gt;</pre> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <div class="demo_block"> <pre class="brush: html">&lt;script type=&#34;text/javascript&#34; src=&#34;https://maps.googleapis.com/maps/api/js?&amp;key=AIzaSyBE1J5Pe_GZXBR_x9TXOv6TU5vtCSmEPW4&#34;&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (p) { var LatLng = new google.maps.LatLng(p.coords.latitude, p.coords.longitude); var geocoder = geocoder = new google.maps.Geocoder(); geocoder.geocode({ 'latLng': LatLng }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { document.getElementById("lblAddress").innerHTML = "Your location: &lt;b&gt;" + results[1].formatted_address + "&lt;/b&gt;"; } } }); }); } else { alert('Geo Location feature is not supported in this browser.'); } &lt;/script&gt; &lt;span id="lblAddress"&gt;&lt;/span&gt;</pre> </div> <p><a class="demo button orange btn btn-red">Demo</a></p>https://www.aspforums.net:443/Threads/104611/Solved-Google-API-User-current-location-using-JavaScript-not-displaying/https://www.aspforums.net:443/Threads/104611/Solved-Google-API-User-current-location-using-JavaScript-not-displaying/Wed, 12 Dec 2018 04:00:44 GMT