Quantcast
Channel: ExeOutput for PHP - G.D.G. Software Forum
Viewing all articles
Browse latest Browse all 1024

Ajax response DELETE not working

$
0
0

@kharismaster wrote:

hi, i tried deleting data with ajax, but there was no response with exeoutput.
In chrome browser it works fine. please help me, where should I fix it. or maybe the exeoutput doesn’t support the DELETE http request method.
Method POST, GET is work fine.
this is my code:

$(document).on('click', 'button.delete_category_button', function() {
        swal({
            title: LANG.sure,
            text: LANG.confirm_delete_category,
            icon: 'warning',
            buttons: true,
            dangerMode: true,
        }).then(willDelete => {
            if (willDelete) {
                var href = $(this).data('href');
                var data = $(this).serialize();

                $.ajax({
                    method: 'DELETE',
                    url: href,
			//url: "http://heserver/public/index.php/categories/4",
                    dataType: 'json',
                    data: data,
                    success: function(result) {
                        if (result.success === true) {
                            toastr.success(result.msg);
                            category_table.ajax.reload();
                        } else { 
                            toastr.error(result.msg);
                        }
                    },
                });
            }
        });
    });

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 1024

Trending Articles