Browse Source

make get location retry api in 5 seconds if the item exists but is empty

master
Craig Stewart 3 months ago
parent
commit
b364b4ec75
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      getlocation.html

+ 2
- 3
getlocation.html View File

@@ -13,8 +13,8 @@ function getLocation() {
document.getElementById("shared").innerHTML = "This Location Id does not appear to exist";
break;
case 204:
document.getElementById("shared").innerHTML = "The Location is currently empty, retrying";
getLocation();
document.getElementById("shared").innerHTML = "The Location is currently empty, retrying in 5 seconds";
setTimeout(getLocation, 5000);
break;
case 200:
document.getElementById("shared").innerHTML = "Location Retrived";
@@ -25,7 +25,6 @@ function getLocation() {
document.getElementById("shared").innerHTML = "There was a problem";
}
};
// document.getElementById("location").innerHTML = "Latitude: " + location.coords.latitude + ", Longitude: " + location.coords.longitude;
}
window.onload = getLocation;
</script>

Loading…
Cancel
Save