是否将 URL 的锚点部分发送到 Web 服务器? [英] Is the anchor part of a URL being sent to a web server?

查看:25
本文介绍了是否将 URL 的锚点部分发送到 Web 服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设有一个 URL,http://www.example.com/#hello.

Say, there's a URL, http://www.example.com/#hello.

  1. 根据标准,#hello 是否会发送到 Web 服务器?
  2. 现代浏览器如何运作?
  1. Will the #hello thing be sent to the web server or not, according to standards?
  2. How do modern browsers act?

推荐答案

这个问题的答案类似于在 ASP.NET 的 URL 中检索锚链接.

The answer to this question is similar to the answers for Retrieving anchor link in URL for ASP.NET.

基本上,根据RFC 1808 - 相对统一资源定位符的标准(见第 2.4.1 节),它说:

Basically, according to the standard at RFC 1808 - Relative Uniform Resource Locators (see Section 2.4.1), it says:

请注意,片段标识符不被视为 URL 的一部分."

"Note that the fragment identifier is not considered part of the URL."

作为 stephbu指出,任何浏览器都不会将锚标记作为 HTTP 请求的一部分发送.它仅在浏览器中本地解释".

As stephbu pointed out, "the anchor tag is never sent as part of the HTTP request by any browser. It is only interpreted locally within the browser".

这篇关于是否将 URL 的锚点部分发送到 Web 服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆