如果我在查询字符串中得到#test,但我似乎找不到它,我会尝试在后端执行某些操作。
有人知道如何获取这些变量吗?
示例网址
loocalhost:3000/#test
谢谢
最佳答案
这称为 fragment identifier .
来自http://www.w3.org/Addressing/URL/uri-spec.html
A reference to a particular part of a document may, including the fragment identifier, look like
http://www.myu.edu/org/admin/people#andy
in which case the string "#andy" is not sent to the server, but is retained by the client and used when the whole object had been retrieved.
关于ruby-on-rails - Ruby on Rails 获取 # 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15533766/