0
爲什麼不我從服務器的響應發送json的請求後,我是什麼doinfg錯JSON請求和響應的Django
$("#chat").submit(function(){
// If user clicks to send a message on a empty message box, then don't do anything.
alert($("#msg").val());
alert(url);
if($("#msg").val() == "") return false;
$.post(url,
alert('22'),
{
time: timestamp,
action: "postmsg",
message: $("#msg").val()
},
function(load) {
$("#msg").val(""); // clean out contents of input field.
// Calls to the server always return the latest messages, so display them.
processResponse(payload);
},
'json'
);
Django的視圖功能:
def ajaxcall(request):
#I have tried both the return statements and there are no exceptions since see the logging
#logging.debug(response)
#return HttpResponse(simplejson.dumps(response), mimetype='application/javascript')
#return response