Ajax for JSON

        $.ajax({
            type: 'get',
            url: base_url + 'admin/' + control + '/sorting_data',
            data: params,
            dataType: 'json',
            success: function(data){
                if(typeof data.status == 'undefined'){
                    alert(data);
                }else if(data.status == 'fail'){
                    alert(data.message);
                }else{
                    if(typeof callback == 'function'){
                        callback.call(null, data.data);
                    }
                }
            },
            error: function(data){
                var errors = data.responseJSON;
                //show_response_error(errors);
            }
        });