jQuery ajaxForm uploadProgress防止flask render_template。

问题描述 投票:1回答:1

我在我的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找到很多东西,任何帮助都将是感激的。

javascript python jquery flask ajaxform
1个回答
0
投票

通过以下方法解决了这个问题 "return_template() "不工作[XMLHttpRequest() & flask] 。

修正方法是在我的ajaxForm中添加以下内容。

        success: function (res) {
            document.write(res);
        }
© www.soinside.com 2019 - 2024. All rights reserved.