skip to Main Content

How to call this data piece in Ajax? – Jquery ajax

I would like to call the meters (732) piece of data from the following json API return: {"results":1,"data":[{"wind":{"degrees":200,"speed_kts":6,"speed_mph":7,"speed_mps":3,"speed_kph":11},"temperature":{"celsius":16,"fahrenheit":61},"dewpoint":{"celsius":14,"fahrenheit":57},"humidity":{"percent":88},"barometer":{"hg":30.06,"hpa":1018,"kpa":101.79,"mb":1017.92},"visibility":{"miles":"Greater than 6","miles_float":6.21,"meters":"10,000+","meters_float":10000},"ceiling":{"code":"BKN","text":"Broken","feet":2400,"meters":732,"base_feet_agl":2400,"base_meters_agl":732},"elevation":{"feet":256,"meters":78},"location":{"coordinates":[-2.27495,53.353699],"type":"Point"},"icao":"EGCC","station":{"name":"Manchester Airport"},"observed":"2020-07-18T00:50:00.000Z","raw_text":"EGCC 180050Z AUTO 20006KT 9999 BKN024 16/14 Q1018","flight_category":"MVFR","clouds":[{"code":"BKN","text":"Broken","feet":2400,"meters":732,"base_feet_agl":2400,"base_meters_agl":732}],"conditions":[]}]} This code doesn't seem to call it: jQuery.ajax({ type: 'GET', url: 'https://api.checkwx.com/metar/EGCC/decoded',…

VIEW QUESTION

Execute Ajax request Only Once – Jquery ajax

$('#addToCart').click(function () { let csrf = $("input[name=csrfmiddlewaretoken]").val(); let trTable = $(this).parents('div')[1]; let customPrice = $($(trTable).children('div')[0]).find('#customPrice').val(); let quantity = $($(trTable).children('div')[1]).find('#quantity').val(); let productID = $('#addToCart').attr('data-product-id'); $.ajax({ url: "{% url 'cart:cart_add' %}", method: 'POST', dataType: 'json', data: { 'csrfmiddlewaretoken': csrf, productID: productID, quantity:…

VIEW QUESTION
Back To Top
Search