0

HTML:

<div class=iplookup>23.25.49.250</div>;
<div class=iplookup>188.2.50.62</div>;

jQuery:

$("div").mouseup(function () {
    IP = $(this).text();
    $.getJSON("http://api.easyjquery.com/ips/", {
        IP: IP
    }, function (data) {
        alert("XXX");
        alert(data.continentName + "\n" + data.countryName + " " + data.cityName);
        $(this).append("=" + data.countryName + "," + data.cityName);

    });

});

What is wrong with this code? Why isn't the alert() shown?

1
  • Nik could have a valid point with his answer. But other potential problems could be so much as there is no return data, the data returned isn't valid JSON (might be a string). Other. Commented Jul 10, 2012 at 17:36

1 Answer 1

0

The service is not returning JSONP, which you need for cross domain calls. See here for similar issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.