amidou kante amidou kante - 1 year ago 70
Ajax Question

Get the correct location of a user to display on the screen

Okay, so this is the javascript that I am using Link . The issue that I am having is that the code displays Earth for the user's location instead of the actual city. And if I change the value of $(".currentLocation").html(city); to $(".currentLocation").html(; instead of a location I just get a blank.

Answer Source

Possibly because you are calling $get instead $.get() in freegeoip request.

Also change the last line to use the getLocation()

$(function() {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download