【发布时间】:2018-06-01 13:10:13
【问题描述】:
我正在尝试在我的 Flash 应用程序中使用 jquery .load 来更新 div,但这不起作用。
routes.py
@app.route('/index', methods=['GET', 'POST'])
@app.route('/', methods=['GET', 'POST'])
def red():
return redirect('/index.html')
@app.route('/index.html', methods=['GET', 'POST'])
def index():
return render_template('index.html', title='Estat')
index.html
<script>
function run() {
$( "#display" ).load( "/index.html #display" );
}
setInterval(run, 1000);
</script>
<div id="display"><h1>word 2</h1></div>
我希望每次在某个时间间隔内更改模板文件时 div 块的内容都会更改。请帮帮我。
【问题讨论】:
-
该脚本在没有flask+python的情况下工作正常。我认为问题出在 index.html
-
您能否将我的回答标记为已接受,以便我知道我已成功回答您的问题
标签: javascript python jquery html flask