【发布时间】:2017-08-20 08:32:55
【问题描述】:
这是我的烧瓶 python 代码:
@app.route('/ques/<string:idd>',methods=['GET', 'POST'])
def ques(idd):
print idd
Javascript 代码:
var counts = {{ test|tojson }};
var text = "";
var texts= "";
for (i = 1; i < counts.length; i=i+2){
texts=counts[i-1];
document.write("<a href=\"{{url_for('ques',idd=texts)}}\">"+counts[i]+"</a></br></br>");
}
如何将idd传递给python函数?
【问题讨论】:
-
这是一段 JavaScript 代码...
-
是的!我如何将 idd 传递给 python 函数? @Yuval Pruss
-
对路由执行get请求?
-
get 请求不会在 python 中,它会是你的 javascript
-
我的代码对吗? @keef 贝克
标签: javascript python html flask