Edit in JSFiddle

function success(position) {
  $("#latitude").text(position.coords.latitude);
  $("#longitude").text(position.coords.longitude)
  $("#source").text(position.source == "browser" ? "Browser geolocation" : "IP address lookup");
}

function error(positionError) {
  console.log(positionError);
}

let options = {
  enableHighAccuracy: true,
  userTimeout: 3000,
};

dbip.getCurrentPosition(success, error, options);
Coords : <span id="latitude"></span> <span id="longitude"></span><br />
Source : <span id="source"></span>

<script src="https://cdn.db-ip.com/js/dbip.js"
  data-api-key="p6bcac47ae71f0285cb6343d9697e56e41a2cb92">
</script>