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