Fragment identifier

Fragment identifier

In computer hypertext, a fragment identifier is a short string of characters that refers to a resource that is subordinate to another, primary resource. The primary resource is identified by a Uniform Resource Identifier (URI), and the fragment identifier points to the subordinate resource. Typically, the fragment identifier is appended to the Uniform Resource Locator (URL —a type of URI) for a hypertext document and is meant to identify a portion of that document.

A fragment identifier is defined by RFC 3986 as an optional component of a "URI reference", and it must conform to a certain syntax. The syntax requires that the fragment identifier be separated from the rest of the URI reference by a # (number sign) character. The separator is not considered part of the fragment identifier.

Examples

  • In HTML applications, http://www.foo.org/foo.html#fragment-identifier refers to the element with the id attribute that has the value fragment-identifier (i.e., id="fragment-identifier") in the document identified by the URI http://www.foo.org/foo.html, which is typically the location from which the document would be obtained via the Internet. The deprecated name attribute can also be used for this purpose in the same manner.

    If the targeted element is located in the current document, a user agent (e.g., Web browser) may simply focus the targeted element (e.g., by scrolling the document view to it) without having to reload it. Otherwise, the user agent will need to first retrieve the document and load the relevant element before it can focus the element.

    Graphical Web browsers typically position pages so that the top of the element identified by the fragment id is aligned with the top of the viewport; thus fragment identifiers are often used in tables of content and in permalinks. The appearance of the identified element can also be changed through the :target CSS pseudoclass; Wikipedia uses this to highlight the selected reference.

    With the rise of AJAX, some websites use fragment identifiers to emulate the back button behavior of browsers for page changes that do not require a reload, or to emulate subpages. (For example, GMail uses a single URL for almost every interface – mail boxes, individual mails, search results, settings – the fragment is used to make these interfaces directly linkable. [ [http://blogoscoped.com/archive/2007-11-17-n25.html Link to Specific Content in Gmail] , Google Blogoscoped, November 17, 2007] ) Other websites use the fragment part to pass some extra information to scripts running on them – for example, Google Video understands permalinks in the format of #01h25m30s to start playing at the specified position [ [http://googlevideo.blogspot.com/2006/07/new-feature-link-within-video_19.html New Feature: Link within a Video] , Official Google Video Blog, July 19, 2006] .

  • In XML applications, fragment identifiers in a certain syntax can be XPointers; for example, the fragment identifier in the URI http://www.foo.org/foo.xml#xpointer(//Rube) refers to all XML elements named "Rube" in the document identified by the URI http://www.foo.org/foo.xml. An XPointer processor, given that URI, would obtain a representation of the document (such as by requesting it from the Internet) and would return a representation of the document's "Rube" elements.

  • In RDF vocabularies, such as RDFS, OWL, or SKOS, fragment identifiers are used to identify resources in the same XML Namespace, but are not necessarily corresponding to a specific part of a document. For example http://www.w3.org/2004/02/skos/core#broader identifies the concept "broader" in SKOS Core vocabulary, but it does not refer to a specific part of the resource identified by http://www.w3.org/2004/02/skos/core, a complete RDF file in which semantics of this specific concept is declared, along with other concepts in the same vocabulary.

Processing

The fragment identifier functions differently than the rest of the URI: namely, its processing is exclusively client-side with no participation from the server. When an agent (such as a Web browser) requests a resource from a Web server, the agent sends the URI to the server, but does not send the fragment. Instead, the agent waits for the server to send the resource, and then the agent processes the resource according to the fragment value. In the most common case, the agent scrolls a Web page down to the anchor element which has an attribute string equal to the fragment value. [http://www.w3.org/TR/webarch/#media-type-fragid Other client behaviors are possible] .

As a consequence, in some circumstances of URL redirection or display of intermediate pages (e.g., login screens) by the server, the browser may not be able to apply the fragment to the resource it ultimately receives from the server. This can be remedied by replacing # in the URL to be redirected with %23, the percent-encoded value of #. Also, applications running on the server do not normally receive the fragment value with the rest of the URI, and are thus unable to take it into account when processing a request.

References

External links

* [http://www.w3.org/TR/webarch/#media-type-fragid Architecture of the World Wide Web, Volume One] 3.2.1. Representation types and fragment identifier semantics

*RFC 2396 4.1. Fragment Identifier

*RFC 3986 3.5. Fragment


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • identifier — [ idɑ̃tifje ] v. tr. <conjug. : 7> • 1610; lat. scolast. identificare, de identicus « identique » 1 ♦ Considérer comme identique, comme assimilable à autre chose (identité qualitative) ou comme ne faisant qu un (avec qqch.). ⇒ assimiler,… …   Encyclopédie Universelle

  • Uniform Resource Identifier — In computing, a Uniform Resource Identifier (URI) is a compact string of characters used to identify or name a resource on the Internet. The main purpose of this identification is to enable interaction with representations of the resource over a… …   Wikipedia

  • Uniform Resource Identifier — Ein Uniform Resource Identifier (Abk. URI; engl. für „einheitlicher Bezeichner für Ressourcen“) ist ein Identifikator und besteht aus einer Zeichenfolge, die zur Identifizierung einer abstrakten oder physischen Ressource dient. URIs werden zur… …   Deutsch Wikipedia

  • Fc-Fragment — Antikörper Molekül: schwere Ketten (rot), leichte Ketten (gelb). Antikörper (Immunglobuline, im internationalen Sprachgebrauch auch Immunoglobulin) sind Proteine (Eiweiße) aus der Klasse der Globuline, die in Wirbeltieren als Reaktion auf… …   Deutsch Wikipedia

  • Uniform Resource Identifier — Pour les articles homonymes, voir Uri (homonymie). Un URI, de l anglais Uniform Resource Identifier, soit littéralement identifiant uniforme de ressource, est une courte chaîne de caractères identifiant une ressource sur un réseau (par exemple… …   Wikipédia en Français

  • Resource (Web) — The concept of Resource is primitive in the Web architecture, and is used in the definition of its fundamental elements. The term was first introduced to refer to targets of Uniform Resource Locators (URLs), but its definition has been further… …   Wikipedia

  • GENIZAH, CAIRO — Introduction The term genizah is a word shortened from the rabbinical Hebrew phrase bet genizah (see also genizah ). Its counterpart in late biblical Hebrew is genez (pl. genazim, ginzei) which in Esther evidently means a treasury, as well as the …   Encyclopedia of Judaism

  • Нормализация URL — (или канонизация URL)  процесс при котором URL приводится к единообразному виду. Цель процесса нормализации заключается в преобразовании URL в нормализованный или канонический вид URL с тем, чтобы определить эквивалентность двух… …   Википедия

  • URI — У этого термина существуют и другие значения, см. Ури (значения). URI (англ. Uniform Resource Identifier)  унифицированный (единообразный) идентификатор ресурса. На английский манер произносится как [ю ар ай], по русски чаще говорят… …   Википедия

  • Number sign — Not to be confused with the Chinese character 井, or the Sharp sign ♯. # Number sign …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”