$(getJson) returning error 1

$(getJson) returning error

  $.ajax({
    url: 'http://127.0.0.1/path/application.json',
    dataType: 'json',
    success: function( data ) {
      alert( "SUCCESS:  " + data );
    },
    error: function( data ) {
      alert( "ERROR:  " + data );
    }
  });

Here is what the above code is Doing:
1. It’s making an AJAX request to the URL http://127.0.0.1/path/application.json
2. It’s expecting the response to be in JSON format
3. If the request is successful, it will alert the user with the message “SUCCESS: ” + data
4. If the request is unsuccessful, it will alert the user with the message “ERROR: ” + data

Similar Posts