#/在 url 中是什么意思? [英] What does #/ means in url?

查看:79
本文介绍了#/在 url 中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发 ROR 网络应用程序.我的网页网址如下所示-

I am working on ROR web apps. My webpage url looks like below-

http://dev.ibiza.jp:3000/facebook/report?advertiser_id=2102#/dashboard

这里我知道adverter_id 是2102,但我不明白#/dashboard 指的是什么?

Here I understood that advertiser_id is 2102 but I couldn't understand what #/dashboard is pointing to?

推荐答案

# 符号后面的 URL 部分通常不会在页面请求中发送到服务器.如果您打开 Web 检查器并查看对页面的请求,您将看到 #/dashboard 部分根本没有包含在请求中.

The portion of the URL which follows the # symbol is not normally sent to the server in the request for the page. If you open your web inspector and watch the request for the page, you will see that the #/dashboard portion is not included in the request at all.

在普通(基本 HTML)网页上,# 符号可用于链接到页面内的某个部分,以便浏览器在页面加载后跳转到该部分.

On a normal (basic HTML) web page, the # symbol can be used to link to a section within the page, so that the browser jumps down to that section after the page loads.

在花哨的 javascript-heavy web 应用程序中,通常使用 # 符号后跟更多的 URL 路径,例如 www.example.com/some-path#/other-path/etc 服务器看不到 URL 的 other-path/etc 部分,但可以让 Javascript 在浏览器中读取,并且可能会根据该 URL 路径显示不同的内容.

In fancy javascript-heavy web applications, the # symbol is commonly used followed by more URL paths, for example www.example.com/some-path#/other-path/etc the other-path/etc portion of the URL is not seen by the server, but is available for Javascript to read in the browser and presumably display something different based on that URL path.

因此,在您的情况下,URL 的第一部分是对服务器的请求:

So in your case, the first part of the URL is a request to the server:

http://dev.ibiza.jp:3000/facebook/report?advertiser_id=2102

URL 的第二部分可以让 Javascript 在页面加载后显示页面的特定视图:

and the second part of the URL could be for Javascript to display a specific view of the page once it has loaded:

#/dashboard

# 符号也用于创建片段标识符并且通常还用于链接到网页中的特定内容(例如使浏览器跳转到页面上的特定部分).

The # symbol is also used to create a Fragment Identifier and is also typically used to link to a specific piece of content within a web page (such as to cause the browser to jump down to a particular section on the page).

正如其他人所提到的,这对 SEO 有影响.为了索引这样的页面,您可能必须采用不同的技术来允许搜索引擎访问# 符号后面"的内容.

As others have mentioned, this has SEO implications. In order to index pages such as this, you may have to employ different techniques to allow the content that is "behind the # symbol" to be accessible to search engines.

这篇关于#/在 url 中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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