简体   繁体   English

在模板中的链接URL中创建锚点

[英]Make anchor in link url available in template

如果我将Backend中的链接设置为页面上的特定内容元素( http://www.test.url/example#999 ),是否有机会在目标模板中获取此锚点ID?

As already mentioned, the hash-value is not part of the http request. 如前所述,哈希值不是http请求的一部分。 Here is an example on how to access the hash on the client side via JavaScript: How to get Url Hash (#) from server side 以下是如何通过JavaScript访问客户端哈希的示例: 如何从服务器端获取Url哈希(#)

It is of course possible to convert the hash to a get or post request on the client side. 当然可以在客户端将哈希转换为get或post请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM