我在我的flask应用程序中创建了一个进度条,在前端,它做了以下工作。
$(function () {
$('form').ajaxForm({
beforeSend: function () {
},
uploadProgress: function (event, position, total, percentComplete) {
uploadPercentage = percentComplete;
}
});
});
不知何故,这使得我在flask中的post路由结束时的以下返回无法运行return render_template('channel_match.html', data=config_data)
真的不知道为什么会这样,也没有通过google找到很多东西,任何帮助都将是感激的。
通过以下方法解决了这个问题 "return_template() "不工作[XMLHttpRequest() & flask] 。
修正方法是在我的ajaxForm中添加以下内容。
success: function (res) {
document.write(res);
}