Answers for "how to use ajax to get temperature with address"

0

how to use ajax to get temperature with address

$.ready(
                $.ajax({
                    method: "GET",
                    url: "https://api.openweathermap.org/data/2.5/weather",
                    data: {
                        appid: {your API key},
                        q: {city name},
                        units: "metric" //for undrestandable units like C,mph,...
                    },
                    dataType: 'json',
                    success: function (data) {
                        alert("success");
                        console.log(data); //for seeing the object details in the console
                    },
                    error: function () {
                        alert("error");
                    }
                }));
Posted by: Guest on August-26-2020

Code answers related to "how to use ajax to get temperature with address"

Code answers related to "Javascript"

Browse Popular Code Answers by Language