Same code in Codepen giving diffferent results <p>I have this pen: <a href="https://codepen.io/dteiml/full/PNMwZo" rel="nofollow">https://codepen.io/dteiml/full/PNMwZo</a> with the following javascript code: </p> <pre><code>$('#getWeather').on('click', function() { navigator.geolocation.getCurrentPosition(success); function success(pos){ // get longitude and latitude from the position object passed in var lng = pos.coords.longitude; var lat = pos.coords.latitude; // and presto, we have the device's location! console.log("test"); $('body').html('You appear to be at longitude: ' + lng + ' and latitude: ' + lat); } }); </code></pre> <p>and html code:</p> <pre><code>&lt;button id="getWeather"&gt; Get my location &lt;/button&gt; &lt;body&gt; &lt;/body&gt; </code></pre> <p>that I forked from somebody that works and one that I created myself <a href="http://codepen.io/dteiml/full/aNevrE" rel="nofollow">http://codepen.io/dteiml/full/aNevrE</a> with the <em>same exact</em> code and settings that doesn't work. What might be the problem?</p>