Skip to content

Commit bd19e5a

Browse files
committed
Example updated
1 parent c782dec commit bd19e5a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,10 @@ Here is a sample code to use IP Geolocation API using JQuery SDK:
109109
var country_code2 = sessionStorage.getItem("country_code2");
110110

111111
if (!ip || !country_name || !country_code2) {
112+
setAsyncParameter(false);
112113
setFieldsParameter("country_name,country_code2");
113114
getGeolocation(handleGeolocationResponse, "YOUR_API_KEY");
114115
}
115-
116-
$(document).ready(function() {
117-
alert("Hello " + country_name + "!");
118-
});
119116

120117
function handleGeolocationResponse(json) {
121118
ip = json.ip;
@@ -126,5 +123,9 @@ Here is a sample code to use IP Geolocation API using JQuery SDK:
126123
sessionStorage.setItem("country_name", country_name);
127124
sessionStorage.setItem("country_code2", country_code2);
128125
}
126+
127+
$(document).ready(function() {
128+
alert("Hello " + country_name + "!");
129+
});
129130
</script>
130131
```

0 commit comments

Comments
 (0)