How to inspect FormData?

前端 未结 15 1503
悲&欢浪女
悲&欢浪女 2020-11-22 08:23

I\'ve tried console.log and looping through it using for in.

Here it the MDN Reference on FormData.

Both attempts are in this fi

15条回答
  •  醉梦人生
    2020-11-22 08:35

      function abc(){ 
        var form = $('#form_name')[0]; 
            var formData = new FormData(form);
            for (var [key, value] of formData.entries()) { 
                console.log(key, value);
            }
            $.ajax({
                type: "POST",
                url: " ",
                data:  formData,
                contentType: false,
                cache: false,
                processData:false,
                beforeSend: function() {
    
                },
                success: function(data) {
    
    
                },
    
           });
    }
    

提交回复
热议问题