hub hub - 1 year ago 70
Ajax Question

How can I get a callback from a JSON request

How do I handle the response of a JSON request?

I tried using this site, but had no success!

Answer Source

As the jQuery API:

  var jqxhr = $.getJSON( "example.json", function() {
   console.log( "success" );
  .done(function() {
    console.log( "second success" );
  .fail(function() {
    console.log( "error" );
  .always(function() {
    console.log( "complete" );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download