JSFiddle - React, Tailwind, and code Playground

by Christian Gambardella

HTML

<script src="http://jquery-geolocation.googlecode.com/files/jquery.geolocation.js"></script>
<form id="weather_form" action="#" method="get">
    <input id="location" type="text">
    <input type="submit" value="wetter abfrage">
</form>

JavaScript

$("#weather_form").submit(function() {
    console.log("starting request");
    
    $.geolocation.find(function(location){
       console.log("found", location.latitude, location.longitude);
        
        $.getJSON('http://www.geomojo.org/cgi-bin/reversegeocoder.cgi?format=json&lat=' + location.latitude + '&long=' location.longitude), function(data) {
            console.log("data", data);
            //$('.result').html('<p>' + data.foo + '</p><p>' + data.baz[1] + '</p>');
        });
    });
    
    return false;
});