1.后端如何得到前端数据
1)如果前端提交的方法为POST:
后端接收时要写methods=[‘GET’,‘POST’]
xx=request.form.get(xx);
xx=request.form[’‘xx’]
2)如果是GET
xx=request.args.get(xx)
2.后端向前端传数据
1) 传单个数据`
return render_template(‘需要传参网址’,xx=u’ xx’);
前端接收:
{{xx}}
2) 传多个数据
先把数据写进字典,字典整体传
return render_template(‘需要传参网址’,**字典名’);
前端接收:
{{字典名.变量名}}

 

关于web表单使用的:https://www.cnblogs.com/zheng1076/p/11307745.html

 

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2021-11-08
  • 2021-11-26
  • 2021-11-26
  • 2021-07-27
  • 2022-03-09
  • 2022-12-23
猜你喜欢
  • 2021-11-26
  • 2021-05-30
  • 2022-12-23
  • 2021-11-21
  • 2021-10-03
  • 2021-10-29
  • 2021-12-07
相关资源
相似解决方案