errorThrown:ReferenceError: data is not defined [How to Solve]

Ajax request

error:function(jqXHR,textStatus,errorThrown)
{
	console.log(jqXHR.); 
	console.log(textStatus);
	console.log(errorThrown);
}

The error function has an error of errorthrown: referenceerror: data is not defined
after investigation, the problem is caused by datatype

datatype:“json”

Change to

datatype:“text”

Problem solving.

Read More: