M
M
MegaPuxapb2018-07-31 13:07:46
JavaScript
MegaPuxapb, 2018-07-31 13:07:46

Ajax, how to find out what data was transferred?

How to find out what was passed to the handler, and whether it was passed at all?

$(function(){
    $(function(){
        'use strict';
        $('.form').on('submit', function(e){
            e.preventDefault();
            if ($(this).valid()) {
                var msg = new FormData(this);
                $.ajax({
                    url: 'scripts/mail.php',
                    type: 'POST',
                    contentType: false, 
                    processData: false, 
                    data: msg,

                    success: function() {
                        $('form').trigger('reset');
                        $('#modalSuccess').modal('show');
                    },
                        error: function() {
                        $('form').trigger('reset');
                        $('#modalError').modal('show');
                    }
                });
            };
        });
    });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-07-31
@MegaPuxapb

open the console in the browser and see what was transmitted and what the server responded to and everything else:
5b60363603074901797980.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question