Yesod redirect to anchor on page

谁都会走 提交于 2019-12-10 14:47:12

问题


Is it possible to redirect to example.com/page#anchor using redirect and Yesod's routing system? If so, how?


回答1:


You can use getUrlRender to get the URL renderer, and then append #anchor to that. For example:

render <- getUrlRender
redirect $ render myRoute <> "#anchor"

It might be worth adding a convenience function to automate this process.



来源:https://stackoverflow.com/questions/20886254/yesod-redirect-to-anchor-on-page

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