jquery post failure 1

jquery post failure

$.post("test.php", function(data) {
   alert("Data Loaded: " + data);
})
.fail(function() { 
   alert("error"); 
})

Here is what the above code is Doing:
1. The $.post() method is used to request data from the server with an HTTP POST request.
2. The first argument is the URL we wish to request (“test.php”).
3. The second argument is the data we wish to pass to the server.
4. The third argument is the data type we wish to receive back from the server.
5. The fourth argument is the callback function that will be executed if the request succeeds.
6. The .fail() method specifies a function to be run if the request fails.

Similar Posts