I cannot get a response from server.. my ajax request from html hit the view in django and django returns an response, but callback function not receiving anything... Where is the problem? Here is my code:
$.ajax({ // create an AJAX call...
type: "GET", // GET or POST
url: "djuka/", // the file to call
dataType: "json",
contentType: 'application/json',
success: function(response) { // on success..
alert("aaaa");
}
});
and view:
def djuka(request):
if request.is_ajax():
print "-->YES"
return HttpResponse(json.dumps({'message' : 'awesome'},ensure_ascii=False), mimetype='application/javascript')
print "-->YES" is executed but alert("aaaa") is never called.....