javascript - Success does not fire after getJson -


i have getjson method in jquery fetches soe location data code

$.getjson('https://nominatim.openstreetmap.org/reverse', {     lat: lat,     lon: lng,     format: 'json', }, function (result) {    var dn = result;    var phn = localstorage.getitem("number");     var new_dn = json.stringify(dn);     $.ajax({              url: 'http://cnn.com/nj.php' ,             type : "post",                         data: {phone: phn, location: new_dn },             datatype: 'json',             success: function()             {                 alert('success');              }                   }); }); 

i want on success code not fire alert

success: function()                 {                     alert('success');                  } 

why so?.

the jqxhr.success(), jqxhr.error(), , jqxhr.complete() callback methods removed of jquery 3.0. can use jqxhr.done(), jqxhr.fail(), , jqxhr.always() instead.

see http://api.jquery.com/jquery.getjson/


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -