Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var requestUrl = "http://ip-api.com/json";
- $.ajax({
- url: requestUrl,
- type: 'GET',
- success: function(json)
- {
- if (json.country = 'Indonesia')
- {
- console.log("Kontent Indonesia");
- }
- console.log("My country is: " + json.country);
- },
- error: function(err)
- {
- console.log("Request failed, error= " + err);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement