def DoubleSelect(request):
print "aaa"
CZKType=request.POST.get('CZKType',None)
czkclass= CZKClass.objects.filter(CZKType=CZKType)
data= {'list':czkclass}
for test in czkclass:
print '1111'
print test.CZKType
print test.CZKName
print '222'
#return render_to_response("CZKStock_add.html",{'czkList':czkclass})
returnHttpResponse("%s" % simplejson.dumps(uni_str(data, encode)), mimetype = "application/json")
为什么 return回不到 success里呢.
success: function(json){
alert('asdasd');
var list = json['list']
if(list){
alert(list[0]);
alert(list[1]);
谢谢你俩的回答, 代码很全,我已经实现了.而且 代码就3行
|