Advertisement
RickyRGT

Ngetest :D

Aug 24th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. var requestUrl = "http://ip-api.com/json";
  2. $.ajax({
  3. url: requestUrl,
  4. type: 'GET',
  5. success: function(json)
  6. {
  7. if (json.country = 'Indonesia')
  8. {
  9. console.log("Kontent Indonesia");
  10. }
  11. console.log("My country is: " + json.country);
  12. },
  13. error: function(err)
  14. {
  15. console.log("Request failed, error= " + err);
  16. }
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement