How to fix XHR finished loading: POST "http://localhost:8080/Final/admin/insert.php"

$.validator.setDefaults({
    submitHandler: function (form) {
        $.ajax({
            url: "insert.php",
            method: "post",
            data: $(form),
            success: function (resp) {
                toastr.success('You have successfully added a new member');
            },
            error: function (error) {
                toastr.error('Unable to add a new member');
            }
        });
    }
});

insert.js

Browser Message XHR finished loading: POST "http://localhost:8080/Final/admin/insert.php".