ip-geolocation-api-sdk-typescript
Advanced tools
Comparing version
@@ -81,4 +81,9 @@ import {GeolocationParams} from './GeolocationParams'; | ||
if (this.readyState === 4) { | ||
if(this.status == 0){ | ||
jsonData = { | ||
"message": "Internet is not connected!" | ||
}; | ||
}else{ | ||
jsonData = JSON.parse(this.responseText); | ||
} | ||
} | ||
@@ -89,3 +94,2 @@ }); | ||
xhr.send(data); | ||
return jsonData; | ||
@@ -104,5 +108,11 @@ | ||
xhr.addEventListener("readystatechange", function () { | ||
if (this.readyState === 4) { | ||
jsonData = JSON.parse(this.responseText); | ||
} | ||
if (this.readyState === 4) { | ||
if(this.status == 0){ | ||
jsonData = { | ||
"message": "Internet is not connected!" | ||
}; | ||
}else{ | ||
jsonData = JSON.parse(this.responseText); | ||
} | ||
} | ||
}); | ||
@@ -109,0 +119,0 @@ xhr.open("POST", "https://api.ipgeolocation.io/"+subUrl+"?apiKey="+apiKey+"", false); |
{ | ||
"name": "ip-geolocation-api-sdk-typescript", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -19,2 +19,14 @@ "main": "IPGeolocationAPI.ts", | ||
"homepage": "https://gitlab.com/ahsanNawaz111/ipGeoLocation-TypeScript#README", | ||
"keywords": [ | ||
"ip", | ||
"ipgeo", | ||
"ip geolocation", | ||
"ip geolocation api", | ||
"time zone", | ||
"ip geolocation sdk", | ||
"geolocation javascript", | ||
"geoip lookup", | ||
"geoip api", | ||
"ip location api" | ||
], | ||
"dependencies": { | ||
@@ -21,0 +33,0 @@ "xmlhttprequest": "^1.8.0" |
7426
8.63%164
7.89%