Saturday, September 12, 2015

How to write ajax method in jquery?

Following snippet shows the ajax method how can we write using JQuery. This method can call as a javascript function also.

//ajax implementation
    function processAjaxForm(_url, element, _data) {
            type: "POST",
            data: _data,
            url: _url,
            processData: false,
            dataType: 'json',
            contentType: false,
            success: function (data) {
                    //if data status as failure
                    var urlval=""+data.message+"";

            error: function (data) {
//in case of general unexpected error

Share your thoughts