JSFiddle - React, Tailwind, and code Playground

by tjnicolaides

JavaScript

function getUserLocation(){
     // try the HTML5 geo API
    getHTML5GeoCoordinates();
    
    // else, ask the user
    askUserforLocation();
}

function getHTML5GeoCoordinates() {
    // try the HTML5 geo API
}

function askUserforLocation() {
     // hey man, where you at   
}

function requestWeatherData(location) {
     // pass location to an ajax request   
}

var myLocation = getUserLocation();

requestWeatherData(myLocation);