Created
July 26, 2018 07:14
-
-
Save Padilo300/d897a72739c4e1c6f51452151a4be9f8 to your computer and use it in GitHub Desktop.
API myIP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function find_my_ip(){ | |
$.ajax({ | |
url: 'https://api.2ip.ua/geo.json', | |
type: 'post', | |
data: '', | |
dataType: 'json', | |
success: function(json) { | |
if(json['region'] == 'Dnipropetrovska oblast'){ | |
$('#dnipro_true').css({'display': 'block','opacity': '1'}); | |
}else{ | |
$('#dnipro_false').css({'display': 'block','opacity': '1'}); | |
} | |
}, | |
error: function () { | |
$('#dnipro_false').css({'display': 'block','opacity': '1'}); | |
}, | |
}); | |
} | |
find_my_ip(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
отправляем с клиента.
Ограничение 100 запросов с одного ip.