Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(
- function (position) {
- $.ajax({
- url: "/WeatherApplication/CurrentPositionWeather",
- type: "POST",
- data: { myLongitude: position.coords.longitude, myLatitude: position.coords.latitude },
- success: function (data) { $("#weatherForecasts").replaceWith(data); }
- });
- }, function (error) {
- //alert("Error occurred. Error code:" + error.code);
- //the errorcode can be:
- //0: unknown error
- //1: permission denied
- //2: position unavailable (error response from location provider)
- //3: timed out
- }
- );
- }
Add Comment
Please, Sign In to add comment