I would like to know why I'm launching a server error (500).
I need to make or import some other type of library or module to run my request ajax
?
$("#email").change(function(){
$.ajax({
data : { "email": $(this).val() },
url : "/validar-email/",
type : "GET",
dataType : 'json',
contentType: 'application/json; charset=UTF-8',
success : function(data){
console.log(data);
}
});
});
Function in the view
def ValidarEmail(request):
if request.is_ajax():
data = serializers.serialize('json', {'respuesta':'ok'})
return HttpResponse(data, content_type='application/json')