i using code below weather city , running error api key though working, there ordering error here missing?
<script type="text/javascript"> $(document).ready(function () { $('#btngetweather').click(function () { var requestdata = $('#txtcity').val() + ',' + $('#txtcountry').val(); var resultelement = $('#resultdiv'); $.ajax({ 'method': 'post', 'url': 'http://api.openweathermap.org/data/2.5/weather?', 'data': { 'q': $('#txtcity').val() + ',' + $('#txtcountry').val(), 'appid': 'e142d6277e3108bf30a12ab09c98ce6f', }, 'success': function (data) { resultelement.html('weather: ' + data.weather[0].main + '<br />' + 'description: ' + data.weather[0].description); } }); }); }); </script>
Comments
Post a Comment