Thursday, 27 April 2017

Get Current Latitude and longitude in jquery


 <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyD4IuRFVcMjWo1qWvBrS3v4uvDXcCiq_c4&sensor=false"></script>
<script type="text/javascript">
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(function (p) {
                alert('Latitude:' + p.coords.latitude + "<br />Longitude: " + p.coords.longitude);

            });
        }
        else {
            alert('Geo Location feature is not supported in this browser.');
        }
</script>

No comments:

Post a Comment