【发布时间】:2017-09-30 05:35:56
【问题描述】:
这个 Web 服务器问题的奥秘是什么。
这是我的代码,它在本地服务器上运行良好,但在 Web 服务器上它不起作用:
$.ajax({
url: "/flask/templates/table.html",
type: "get",
data: {jsdata: $( "#select option:selected" ).text()},
success: function(response) {
$("#place_for_suggestions").html(response);
},
error: function(xhr) {
// handle error
}
});
烧瓶一侧:
@FlaskApp2.route('/flask/templates/table.html', methods=['GET', 'POST'])
def table():
modid = request.args.get('jsdata')
print "Hello!!!!!!!!!!!!!!!!", modid
return render_template('table.html')
我尝试查看@FlaskApp2.route 中的任何活动,但我只看到静默!
这段代码有什么问题?
【问题讨论】:
-
能不能看看浏览器发出的网络请求是什么,把请求数据贴在这里。
-
GET domen.com/flask/templates/table.html?jsdata=Data%20Air HTTP/1.1 主机:domen.com 连接:keep-alive 接受:/ X-Requested-With:XMLHttpRequest 用户代理:Mozilla/5.0 ( Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Referer: domen.com/flask/rest Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8饼干:__utma=259990281.1969885139.1506122487.1506122487.1506737103.2; __utmz=259990281.1506122487.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
-
我有 404 错误!但是为什么???