Answers for "2jquery.min.js:2 Uncaught TypeError: Illegal invocation"

7

jquery ajax Uncaught TypeError: Illegal invocation

This error is due to formData which is json object and by default ajax requrie
values to be in string format and as a solution

1. you can either remove formData and pass the values separately 
	data: { username: document.getElementById('createUserForm').value }

2. you can set the dataType to be 'json' and processData to be false
    
	$.ajax({
        url : base_url+'index.php',
        type: 'POST',
        dataType: 'json',
        data: data,
        cache : false,
        processData: false
    })
Posted by: Guest on September-18-2020
0

jquery-3.4.1.min.js:2 Uncaught (in promise) TypeError: Illegal invocation

var form = $('#AddPersonnelForm')[0];
var frmData = new FormData(form);



processData: false,
contentType: false,
Posted by: Guest on March-09-2021

Code answers related to "2jquery.min.js:2 Uncaught TypeError: Illegal invocation"

Code answers related to "Javascript"

Browse Popular Code Answers by Language