Possible Duplicate:
django file upload from jsonDjango的
你好我使用從模板下面的AJAX上傳,但我沒有得到的Django view.What響應Ajax請求的響應是錯誤的here..i沒有看到任何警示
function ajax_upload(formid)
{
var form = $(formid);
form.ajaxSubmit({
dataType: 'json',
success: function (data) {
alert("Hereeeeeeee");
if(data.status == '1')
{
alert("Uploaded Successfull");
}
else
{
alert("Uploaded UnSuccessfull :(");
}
}
}) ;
}
EDIT
Django的:
def someview(request):
response_dict={'status':1}
logging.debug("seen") //This is seen in the logs
return HttpResponse(simplejson.dumps(response_dict), mimetype='application/javascript')
EDIT1
另請參見django file upload from json
我曾試過但我仍然沒有看到任何迴應,我甚至可以做出迴應。努力確定問題是什麼 – Rajeev 2012-07-18 12:26:42