后台视图函数、前端html页面和jquey中循环的用法
后台view:
res={'1':2,'2':2,'3':3}
for k,v in res.items:
print (k,v)
前端html
{%for k,v in res}
{{v}}
{%endfor}
jquey中
$.each(res),function(k,v){
k,v}
后台view:
res={'1':2,'2':2,'3':3}
for k,v in res.items:
print (k,v)
前端html
{%for k,v in res}
{{v}}
{%endfor}
jquey中
$.each(res),function(k,v){
k,v}