Django. How to redirect to url with fragment identifier

自作多情 提交于 2019-12-11 09:31:34

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/11053690/django-how-to-redirect-to-url-with-fragment-identifier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!