Telize

СПЛАЧЕНО
(Ким) Frederic Cambus | Оновлено a month ago | Location
Популярність

9.8 / 10

Затримки

84ms

Рівень обслуговування

100%

Health Check

N/A

Повернутися до всіх обговорень

How to use JSON with paid service.

Rapid account: Blankisthenewblack
blankisthenewblack
8 years ago

Hi, we used your free service, loved it and are more than happy to use the paid version. We cant seem to get it to work though. We set up an application. Got our key for that app and put it in the below client side call. We get the popup alert but the IP address is blank. The application is receiving requests so the issue must be with “json.ip”? Any assistance would be appreciated.

<script type=“application/javascript”>
function getgeoip(json){
window.alert("My IP address is : ", json.ip);
}
</script>

<script type=“application/javascript” src=“https://telize-v1.p.mashape.com/geoip?callback=getgeoip&mashape-key=OUR_X-Mashape-Key_FROM_THE_APPS_DOCUMENTATION_TAB”></script>

Rapid account: Fcambus
fcambus Commented 8 years ago

Hello,

Thanks for subscribing, glad you were able to get the new endpoint working.
For info, it seems you had a typo in your first example : json VS jsonp.

Regards.

Rapid account: Blankisthenewblack
blankisthenewblack Commented 8 years ago

Scratch that, I am able to get the following or document.write to work so it must just not like the window alert:

function getgeoip(json){
if (json.country_code == ‘US’) {
window.location.href = ‘http://google.com/’;
}
}

Thanks!

Rapid account: Blankisthenewblack
blankisthenewblack Commented 8 years ago

posting my code again without the script tags:

function getgeoip(json){
window.alert("My IP address is : ", jsonp.ip);
}

type=“application/javascript” src=“https://telize-v1.p.mashape.com/geoip?callback=getgeoip&mashape-key=OUR_X-Mashape-Key_FROM_THE_APPS_DOCUMENTATION_TAB

Приєднуйтесь до обговорення — додайте повідомлення нижче:

Вхід / Реєстрація, щоб публікувати нові повідомлення