【问题标题】:What type of URL is "www.example.com/#/bar/1"?“www.example.com/#/bar/1”是什么类型的 URL?
【发布时间】:2016-02-27 23:36:03
【问题描述】:

我见过很少有这种形式的 URL

www.example.com/#/bar/1

如何解释这个 URL?据我所知,# 代表页面的一个片段,但在这里看起来完全不同。

【问题讨论】:

    标签: url


    【解决方案1】:

    请注意,这不是 URL,因为它缺少一个方案。我假设你的意思是http(或https),所以网址是

    http://www.example.com/#/bar/1
    

    (第一个)# 启动 fragment identifier component

    所以/bar/1 是该 URL 的片段。 (/ is allowed in a fragment;见list of all allowed characters in the fragment identifier component。)

    是否以及以何种方式使用此片段取决于网站。这种 URL 设计通常由通过 JavaScript 提供内容的网站使用。

    【讨论】:

      【解决方案2】:

      它用于使用哈希重新加载页面。

      有关详细信息,请参阅 Mozillas window.location

      【讨论】:

        猜你喜欢
        • 2015-09-20
        • 1970-01-01
        • 1970-01-01
        • 2015-02-21
        • 2017-11-02
        • 2016-11-06
        • 2022-07-07
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多