ZAjax – a Javascript library to send Ajax request – GET/POST – JOSN


Hello Developers,

I have written a library which helps to send and process AJAX requests with JSON data. Right now it accepts HTTP GET and HTTP POST Json requests. You can download from below repository

https://github.com/swagatblog/zAjax

You also can extend this to your requirement like POST stream, GET custom object etc.

Sample code to use this:

****************************************************************

 var url=’http://yourapiurl.com/getinfi’;

var requestType=’GET’;

var data={id:1120}; //JSON data

var successCallback= function(response){

//implement your code

};

var failureCallback= function(response){

//implement your code

};

var contentType = ‘application/json’;

ZScript.Ajax.send-request(url, requestType, contentType, data, successCallback, failureCallback);

This is a very simple to use library and sample shows how to send a GET request .

Best Regards

Swagat

Advertisements