Request Dev Services ยป

cdev.co / Notes /

Get user coordinates without SSL or Geolocations (JS tip)

Sadly, the great Geolocations API is following the current trend of requiring a SSL or secure HTTPS requests – yes, it’s probably good for the long run, but kill those dev environments we love and need. Luckily, there still a client-side JS solution – and it’s as easy as this.

$.get("http://ipinfo.io", function (response) {
     var coords = response.loc;
     console.log("Coords: " + response.loc);
}, "jsonp");

Here’s a jsFiddle.

About the Author
Cameron Cashwell Web Developer
I build websites, web apps, and software. Wanna work together? Let's chat about your project!

Leave a Reply

Be the First to Comment!

Notify of
avatar