Skip to content

Commit

Permalink
8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Fixtr committed Feb 4, 2024
1 parent d14301b commit 3fefde3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ <h1 class="hidden" id="greeting"></h1>
<script src="js/quotes.js"></script>
<script src="js/background.js"></script>
<script src="js/todo.js"></script>
<script src="js/weather.js"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions js/js/weather.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function onGeoOk(position) {
const lat = position.coords.latitude;
const lng = position.coords.longitude;
console.log("You live in", lat, lng);
}
function onGeoError() {
alert("Can't find you. No weather for you.");
}

navigator.geolocation.getCurrentPosition(onGeoOk, onGeoError);

0 comments on commit 3fefde3

Please sign in to comment.