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.

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 does not belong to 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 could be considered as 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 than the rest of the URI: namely, its processing is exclusively client-side with no participation from the web server of course 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

References

  1. "RFC 3986 Uniform Resource Identifier (URI): Generic Syntax". Internet Engineering Task Force. January 2005. Retrieved March 6, 2012.
  2. "Representation types and fragment identifier semantics". Architecture of the World Wide Web, Volume One. W3C. 2004. Retrieved July 13, 2011.
  3. "Validity constraint: ID". XML 1.0 (Fifth Edition). W3C. 2008. Retrieved July 13, 2011.
  4. "xml:id Version 1.0". W3C. 2005. Retrieved July 13, 2011.
  5. "Issue 77024". Chromium. 2011. Retrieved July 13, 2011.
  6. "Media Type Review". W3C Media Fragments Working Group. 2009. Retrieved April 29, 2009.
  7. "New Feature: Link within a Video". Google. July 19, 2006. Retrieved July 13, 2011.
  8. Link to Specific Content in Gmail, Google Blogoscoped, November 17, 2007
  9. "PDF Open Parameters - Specifying PDF Open Parameters in a URL" (PDF). Adobe. July 11, 2005. Retrieved July 13, 2011.
  10. "RFC 3778 - The application/pdf Media Type". The Internet Society. May 2004. Retrieved Aug 26, 2013.
  11. http://www.w3.org/TR/SVG11/linking.html#SVGFragmentIdentifiers
  12. "Media Fragments URI 1.0 (basic) W3C Recommendation". Retrieved September 25, 2012.
  13. "Pypi md5 check support". Retrieved July 13, 2011. 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
  14. 1 2 "Hash URIs". W3C Blog. May 12, 2011. Retrieved July 13, 2011.
  15. "Proposal for making AJAX crawlable". Google. October 7, 2009. Retrieved July 13, 2011.
  16. "(Specifications) Making AJAX Applications Crawlable". Google. Retrieved March 4, 2013.
  17. Fragment Search, gerv.net
  18. 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
  19. Text-Search Fragment Identifiers, K. Yee, Network Working Group, Foresight Institute, March 1998
  20. The technology behind LiveURLs, accessed 2011-03-13
  21. "Web Marker" Firefox add-on, accessed 2011-03-13

External links

This article is issued from Wikipedia - version of the 12/1/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.