Django的。如何重定向到具有片段标识符的URL [英] Django. How to redirect to url with fragment identifier
本文介绍了Django的。如何重定向到具有片段标识符的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
在JS中做如果您正在重定向到其他页面,只需将 #whatever
添加到重定向网址,直接转到锚点。
For example in some cases after POST or GET request I want to redirect user not only to specific page, but to a specific part of page. What would be better: implement this in Django(reconstruct redirect url?) or implement this in javascript?
解决方案
Why would you want to do it in JS? If you're redirecting to a different page already, just add #whatever
to the redirect URL to go direct to the anchor.
这篇关于Django的。如何重定向到具有片段标识符的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文