Fragment identifier

Last updated

In computer hypertext, a fragment identifier is a 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.

Contents

The fragment identifier introduced by a hash mark # is the optional last part of a URL for a document. It is typically used to identify a portion of that document. The generic syntax is specified in RFC 3986. The hash-mark separator in URIs is not part of the fragment identifier.

Basics

In URIs, a hash mark # introduces the optional fragment near the end of the URL. The generic RFC 3986 syntax for URIs also allows an optional query part introduced by a question mark ?. In URIs with a query and a fragment, the fragment follows the query. Query parts depend on the URI scheme and are evaluated by the server—e.g., http: supports queries unlike ftp:. Fragments depend on the document MIME type and are evaluated by the client (web browser). Clients are not supposed to send URI fragments to servers when they retrieve a document, and without help from a local application (see below) fragments do not participate in HTTP redirections. [1]

A URI ending with # is permitted by the generic syntax and is a kind of empty fragment. In MIME document types such as text/html or any XML type, empty identifiers to match this syntactically legal construct are not permitted. Web browsers typically display the top of the document for an empty fragment.

The fragment identifier functions differently to the rest of the URI: its processing is exclusively client-sided with no participation from the web server, though the server typically helps to determine the MIME type, and the MIME type determines the processing of fragments. When an agent (such as a web browser) requests a web 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 document type and fragment value. [2]

Examples

Proposals

Several proposals have been made for fragment identifiers for use with plain text documents (which cannot store anchor metadata), or to refer to locations within HTML documents in which the author has not used anchor tags:

See also

Related Research Articles

A document type definition (DTD) is a set of markup declarations that define a document type for an SGML-family markup language.

HTML Hypertext Markup Language

Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript.

Hypertext Transfer Protocol Application protocol for distributed, collaborative, hypermedia information systems

The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, where hypertext documents include hyperlinks to other resources that the user can easily access, for example by a mouse click or by tapping the screen in a web browser.

A Uniform Resource Identifier (URI) is a string of characters that unambiguously identifies a particular resource. To guarantee uniformity, all URIs follow a predefined set of syntax rules, but also maintain extensibility through a separately defined hierarchical naming scheme.

An HTML element is a type of HTML document component, one of several types of HTML nodes. HTML document is composed of a tree of simple HTML nodes, such as text nodes, and HTML elements, which add semantics and formatting to parts of document. Each element can have HTML attributes specified. Elements can also have content, including other elements and text.

vCard, also known as VCF, is a file format standard for electronic business cards. vCards are often attached to e-mail messages, but can be exchanged in other ways, such as Multimedia Messaging Service (MMS), on the World Wide Web, instant messaging or through QR code. They can contain name and address information, telephone numbers, e-mail addresses, URLs, logos, photographs, and audio clips.

A Uniform Resource Name (URN) is a Uniform Resource Identifier (URI) that uses the urn scheme.

Web annotation refers to

  1. online annotations of web resources such as web pages or parts of them, and
  2. a set of W3C standards developed for this purpose.

On the World Wide Web, a query string is a part of a uniform resource locator (URL) that assigns values to specified parameters. A query string commonly includes fields added to a base URL by a Web browser or other client application, for example as part of an HTML form.

XML Signature defines an XML syntax for digital signatures and is defined in the W3C recommendation XML Signature Syntax and Processing. Functionally, it has much in common with PKCS#7 but is more extensible and geared towards signing XML documents. It is used by various Web technologies such as SOAP, SAML, and others.

The data URI scheme is a uniform resource identifier (URI) scheme that provides a way to include data in-line in Web pages as if they were external resources. It is a form of file literal or here document. This technique allows normally separate elements such as images and style sheets to be fetched in a single Hypertext Transfer Protocol (HTTP) request, which may be more efficient than multiple HTTP requests, and used by several browser extensions to package images as well as other multimedia contents in a single HTML file for page saving. As of 2015, data URIs are fully supported by most major browsers, and partially supported in Internet Explorer and Microsoft Edge.

JSON Text-based open standard designed for human-readable data interchange

JavaScript Object Notation is an open standard file format, and data interchange format, that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and array data types. It is a very common data format, with a diverse range of applications, such as serving as a replacement for XML in AJAX systems.

Percent-encoding, also known as URL encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI) under certain circumstances. Although it is known as URL encoding, it is, in fact, used more generally within the main Uniform Resource Identifier (URI) set, which includes both Uniform Resource Locator (URL) and Uniform Resource Name (URN). As such, it is also used in the preparation of data of the application/x-www-form-urlencoded media type, as is often used in the submission of HTML form data in HTTP requests.


A web resource, or simply resource, is any identifiable thing, whether digital, physical, or abstract. Resources are identified using Uniform Resource Identifiers. In the Semantic Web, web resources and their semantic properties are described using the Resource Description Framework.

The feed URI scheme was a suggested uniform resource identifier (URI) scheme designed to facilitate subscription to web feeds; specifically, it was intended that a news aggregator be launched whenever a hyperlink to a feed URI was clicked in a web browser. The scheme was intended to flag a document in a syndication format such as Atom or RSS. The document would be typically served over HTTP.

URI normalization Process by which URIs are standardized

URI normalization is the process by which URIs are modified and standardized in a consistent manner. The goal of the normalization process is to transform a URI into a normalized URI so it is possible to determine if two syntactically different URIs may be equivalent.

A media type is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication of these classifications. Media types were originally defined in Request for Comments RFC 2045 (MIME) Part One: Format of Internet Message Bodies in November 1996 as a part of MIME specification, for denoting type of email message content and attachments; hence the original name, MIME type. Media types are also used by other internet protocols such as HTTP and document file formats such as HTML, for similar purposes.

The file URI scheme is a URI scheme defined in RFC 8089, typically used to retrieve files from within one's own computer.

A document type declaration, or DOCTYPE, is an instruction that associates a particular XML or SGML document with a document type definition (DTD). In the serialized form of the document, it manifests as a short string of markup that conforms to a particular syntax.

A Uniform Resource Locator (URL), colloquially termed a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI), although many people use the two terms interchangeably. Thus http://www.example.com is a URL, while www.example.com is not.</ref> URLs occur most commonly to reference web pages (http), but are also used for file transfer (ftp), email (mailto), database access (JDBC), and many other applications.

References

  1. "RFC 3986 Uniform Resource Identifier (URI): Generic Syntax". Internet Engineering Task Force. January 2005. Retrieved 2012-03-06.
  2. "Representation types and fragment identifier semantics". Architecture of the World Wide Web, Volume One. W3C. 2004. Retrieved 2011-07-13.
  3. "Scroll To Text Fragment". Chrome Platform Status. Google Chrome . Retrieved 2020-05-18.
  4. Kelly, Gordon. "Google Chrome 80 Released With Controversial Deep Linking Upgrade". Forbes. Retrieved 2020-06-04.
  5. "WICG/ScrollToTextFragment: Proposal to allow specifying a text snippet in a URL fragment". GitHub. WebPlatform.org Incubator Community Group at W3C . Retrieved 2020-05-18.
  6. "Validity constraint: ID". XML 1.0 (Fifth Edition). W3C. 2008. Retrieved 2011-07-13.
  7. "xml:id Version 1.0". W3C. 2005. Retrieved 2011-07-13.
  8. "Issue 77024". Chromium. 2011. Retrieved 2011-07-13.
  9. "Media Type Review". W3C Media Fragments Working Group. 2009. Retrieved 2009-04-29.
  10. "New Feature: Link within a Video". 2006-07-19. Retrieved 2011-07-13.
  11. Link to Specific Content in Gmail, Google Blogoscoped, 2007-11-17
  12. "Parameters for Opening PDF Files – Specifying parameters in a URL" (PDF). Adobe. April 2007. Retrieved 2017-09-20.
  13. "RFC 3778 – The application/pdf Media Type". The Internet Society. May 2004. Retrieved 2017-09-20.
  14. "Linking – SVG 1.1 (Second Edition)".
  15. "Media Fragments URI 1.0 (basic) W3C Recommendation" . Retrieved 2012-09-25.
  16. "Pypi md5 check support" . Retrieved 2011-07-13. Pypi has the habit to append an md5 fragment to its egg urls, we'll use it to check the already present distribution files in the cache
  17. 1 2 "Hash URIs". W3C Blog. 2011-05-12. Retrieved 2011-07-13.
  18. "HTML 5.1 2nd Edition". W3C. 2017. Retrieved 2018-08-03.
  19. "Proposal for making AJAX crawlable". 2009-10-07. Retrieved 2011-07-13.
  20. "(Specifications) Making AJAX Applications Crawlable". Google Inc. Retrieved 2013-05-04.
  21. "Manipulating the browser history". Mozilla Developer Network. Retrieved 2017-02-23.
  22. "Deprecating our AJAX crawling scheme". Official Google Webmaster Central Blog. Retrieved 2017-02-23.
  23. Fragment Search, gerv.net
  24. Fragment identifiers for plain text files, Erik Wilde and Marcel Baschnagel, Swiss Federal Institute of Technology (ETH Zürich), Proceedings of the sixteenth ACM conference on Hypertext and hypermedia doi : 10.1145/1083356.1083398
  25. Text-Search Fragment Identifiers, K. Yee, Network Working Group, Foresight Institute, March 1998
  26. LiveURLs project
  27. The technology behind LiveURLs, accessed 2011-03-13
  28. "Web Marker" Firefox add-on, accessed 2011-03-13
  29. "EPUB Canonical Fragment Identifiers 1.1". idpf.org. Retrieved 2020-06-03.