K
K
KhanTengri2011-04-24 20:25:14
Uniform Resource Identifier
KhanTengri, 2011-04-24 20:25:14

What do the symbols #! in the URL of some sites?

Recently, more and more often I see them coming right after the domain:
-> music.yandex.ru/#!/album/10030
-> twitter.com/#!/KremlinRussia
Is this a link to some server script? But why exactly, what is the advantage?
I remember twitter used to have addresses without this pair, and now they have ...

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
sajgak, 2011-04-24
@KhanTengri

a simple hash navigation example (the dynamic part of the page loads via ajax without reloading the main container)! is needed in order to distinguish a regular anchor from a link. By the way, with the release of history.pushstate , there is no need for such links anymore. The truth is not yet supported by the opera and, accordingly, no.

K
Konstantin Kitmanov, 2011-04-24
@k12th

The part after the hash mark once served as a link to a specific part of the page. On Habré, this is still the case - click on the link with the number of comments under the topic. If there is a tag in the page code

<a name="comments" …/>
, then when opening an address ending in #comments, the browser will scroll the page to this link.
Client scripts can track the appearance and change of this part in the address, and take actions based on its content. The simplest application is AJAX navigation. Without such addresses, it is impossible to link to a specific internal page. In addition, the back / forward buttons in the browser work with such a trick.
As correctly noted above, there is already a mechanism that allows you to do without it, but, alas, it does not work everywhere.

A
Atrax, 2011-04-24
@Atrax

And this is also done so that Google can index AJAX-based sites
code.google.com/intl/ru-RU/web/ajaxcrawling/docs/specification.html

1
1nd1go, 2011-04-24
@1nd1go

This means the idiocy of the developers: habrahabr.ru/blogs/webdev/113842/

R
Riateche, 2011-04-25
@Riateche

I might add that these addresses may soon become a thing of the past. In the new Firefox and Chrome, it is possible to change the main part of the address through scripts without reloading the page. There is no need to use a hash.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question