Here is my js that uses Jquery blockUI plug-in:
$(document).ajaxStop($.unblockUI);
$('#submit-id-submit').click(function() {
$.blockUI({message:'<h1><img src="{% static 'css/spinner.gif' %}" /> Just a moment ...</h1>'});
$.ajax({
url: "/search/test/",
cache:'false',
dataType: 'text',
type:"GET",
success: function(data){
alert(data);
},
error: function(data){
alert('error; '+ eval(error));
}
});
});
my view:
def test_ajax(request):
time.sleep(20)
print "in test_ajax"
return HttpResponse("hell world")
url(r"search/test/$", test_ajax,name="dummy"),
First, I see the ajax call is returning error (because I get alert from error. but it does not show the error message)
Secondly, my view test_ajax is not called, because I would expect the print statement there to be executed, but it does not execute.
I cannot figure out what is going wrong here.