Collection of Ajax requests via Javascript.
This library will support to implement :
- i) GET
- ii) POST
- iii) JSONP
<script src="/path/to/javascript_ajax.js"> </script>
i) ajax.get(URL, DATA, CALLBACK);
ii) ajax.post(URL, DATA, CALLBACK);
iii) ajax.jsonp(URL, DATA, CALLBACK);
Action URL to handle request.
List of form data to submit.
Function to handle request after the request.
<script src="./javascript_ajax.js"> </script>
<script>
/** GET Request. */
ajax.get('/path/to/handle/', {foo: 'bar'}, function(response) {
// Function to Handle Response.
console.log(response);
});
/** POST Request. */
ajax.post('/path/to/handle/', {foo: 'bar'}, function(response) {
// Function to Handle Response.
console.log(response);
});
/** JSONP Request. */
ajax.jsonp('/path/to/handle/', {foo: 'bar'}, function(response) {
// Function to Handle Response.
console.log(response);
});
</script>