RT,在前端页面( index.html )中创建两个按钮,点击 load 或者 save 按钮都需要 flask 后台框架来响应执行操作,点击两个按钮后不跳转页面(或者跳转后的页面仍然为 index.html ),也就是说两个按钮对应的 url 都是'/',那么问题来了,flask 后台框架怎么在 url 为'/'的方法中区分这两个按钮哪个被按下呢?
index.html:
<button class="btn btn-default btn-primary" name="load">Load</button> <button class="btn btn-default btn-info" name="save">Save</button> @app.route('/') def index(): pass #问题就是需要在这里区分两个按钮谁被按下了 希望各位大大不啬赐教,在此先谢谢了!
