The following jQuery will call a Python script. The Python script is able to receive the post data. However, the jQuery is unable to receive the response by the Python script.
$(document).ready(function(){
$("#dd").blur(function(){
$.post("http://127.0.0.1:8000/validation/trial/",
{
dd:document.getElementById("dd").value
},
function(data){
alert("Data: " + data);
});
});
});
The following is the python script:
def trial(request):
dd = request.POST.get('dd')
print dd
return HttpResponse(dd)