What does #/ means in url?
Asked Answered
D

4

21

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

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

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

Deegan answered 12/8, 2016 at 2:49 Comment(0)
I
39

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.

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.

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.

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

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).

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.

Itacolumite answered 12/8, 2016 at 3:14 Comment(0)
F
1

# symbol is called anchor, it redirects to a specific position on the html page.

It's a crawling technique , you could read more Here

Fernandina answered 12/8, 2016 at 2:51 Comment(1)
The link states at the top: "This recommendation is officially deprecated as of October 2015". You should get something that's current.Malony
C
1

Providing another example

Here's a request to github for the sourcecode of a java class

https://github.com/spring-cloud/spring-cloud-consul/blob/master/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/serviceregistry/ConsulServiceRegistry.java

By appending this with "#L90" the web browser will make the same request, and then scroll to line 90 and highlight the code.

https://github.com/spring-cloud/spring-cloud-consul/blob/master/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/serviceregistry/ConsulServiceRegistry.java#L90

Your web browser made the same request to the github server, but in the anchored case, performed the additional action of highlighting the selected line after the response was received.

Caiman answered 10/1, 2019 at 21:38 Comment(0)
U
0

after # is the hash of the location; the ! the follows is used by search engines to help index AJAX content. After that can be anything, but is usually rendered to look as a path (hence the /)

Urbanity answered 12/8, 2016 at 2:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.