问题描述
我使用 Flask url_for 作为 Flask 应用程序的一部分进行重定向。
例如
$('#myForm').validate({
lang: 'es' // as the filename ends
});
这将重定向到:next_page = url_for('help.index')
是否可以将 div id 传递给 <a href="http://example.com/help">
以重定向到:
url_for
?
解决方法
我是这样做的,而不是 url for
`next_page = "/help#shipping"`
这会做同样的事情,但是如果你想使用 url_for 然后
`next_page = f"{url_for("help.index")}#shipping"`