python - 我如何找到 Pyramid 中 URI 中的 anchor ?

标签 python uri anchor pyramid

简单地说,在 Pyramid 中,当有人请求页面时,例如:

/foo/#bar

我如何找出 anchor 是什么?在这种情况下,它将是 bar。这看起来应该是微不足道的,但我不确定如何在 Pyramid 中检索此信息。

request.current_route_path(), request.urlrequest.path 只会返回 /foo/在这种情况下。

(Pyramid 真的完全没有意识到这一点吗?也许服务器根本就没有收到过这些信息,而我直到现在才意识到这一点)

最佳答案

客户端永远不会将片段发送到服务器;您将需要使用 JavaScript 在客户端处理它。

关于python - 我如何找到 Pyramid 中 URI 中的 anchor ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11927755/

相关文章:

android - Python + MIDI + Ableton Live,怎么做?

email - 电子邮件 mailto 链接是有效的 URL 吗?

javascript - SVG anchor 当前页面突出显示

html - 人们为什么要在标签中添加“#”作为href?

python - Python中函数的奇怪的热编码问题

python - 有 python 3.x 的 LINQ 吗?

android - apache commons IOUtils.toByteArray 不为 android 编译

jquery - 禁用 jquery 中 anchor 上的 .click 功能

python - 使用 python 在 unix 中获取正在运行的进程列表的最佳方法是什么?

php - 从 url codeigniter 获取值参数