Questions tagged [fragment-identifier]

The fragment-identifier is the part of the URI/URL following the hash symbol. In the case of `http://mysite.com/page/#/one` then `/one` would be the fragment-identifier.

The fragment-identifier is the part of the URI/URL following the hash symbol. In the case of http://mysite.com/page/#/one then /one would be the fragment-identifier.

In URIs a hashmark # 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.

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.

For more info see wiki.

243 questions
0
votes
1 answer

Identifying the candidate duplication in mysql database

I have user name, dob, emailID, phone no etc in my db, each time a new entry is made i have to identify that user already exists in my db or not. By searching whole database, What keys will identify anyone uniquely? How can I do it? I have to do it…
VIKASH
  • 311
  • 1
  • 3
  • 6
0
votes
2 answers

How to use fragment identifiers in path helpers in phoenix webframework?

Is there a way to add a fragment identifier to a path helper? I try to link back from my login page to the about section in the landing page. ABOUT Using this path helper, I only get back to the landing page:…
Yufrend
  • 113
  • 2
  • 8
0
votes
2 answers

How would I jump to a point in a page using the hash or pound symbol(#) with a get variable?

I found this tutorial that explains what I want to do using html but when I echo out the code with a get variable there is no affect to the page. I would use, for example, the following code: echo "Click here…
Yesterday
  • 561
  • 1
  • 15
  • 31
0
votes
1 answer

How to replace Hash in Link

I want to add the hash of the url to the href attribute of a navigation: I have this code: $(window).on('hashchange', function (e)…
KSPR
  • 2,212
  • 4
  • 29
  • 46
0
votes
0 answers

Name/fragment link not working on dynamically built page

I'm building a page dynamically: document.body.appendChild..... and trying to build/link to sections with fragment identifies on the fly. when I attach an anchor element with a fragment link (after creating/attaching the corresponding div:…
Sam
  • 49
  • 7
0
votes
0 answers

How Do I Make HTML Comment Script Use Hash Fragment ID In URL

I am using a comment box on my blogs from htmlcommentbox.com, and the service allows me to ignore query strings in my urls, but how do I recognize fragment IDs after the hash? Is there a way for me to edit the code given to me with…
0
votes
1 answer

In ember, how can I correctly treat routes whose pathnames contain hashes (#) as fragment identifiers?

In my router I have the following block: Router.map(function() { this.route('stuff'); this.route('registration', { path: '/registration' }); this.route('registration-first', { path: '/registration#first' }); }); The reason I wish to do this…
DarkKunai99
  • 105
  • 1
  • 4
  • 13
0
votes
0 answers

Angular.js: How to Append Hash Fragment after clicking element and making this shareable

Apologies for the somewhat basic question. On an Angular single page application, I'm trying to create a fragment identifier after clicking on an element and changing its CSS display attribute from display:none to display:inline. For instance, I'd…
rpivovar
  • 3,150
  • 13
  • 41
  • 79
0
votes
1 answer

jQuery: Show/hide items using URL hash / fragment identifier

I have a basic jQuery click function to shows/hides items based on their data-filter attribute—not using a plugin like Isotope, just a simple show/hide function— and I'd also like to apply the filter using the URL hash, when present, and append an…
nickpish
  • 839
  • 4
  • 24
  • 43
0
votes
1 answer

Execute Code When The URL Has Hash OR HASH Changes After Load?

Any assistance would be greatly appreciated! Execute code when a hash exists on load: if(location.hash) { //code; } Execute code when the hash changes: $(window).hashchange(function(){//code;}); How do I combine these 2 checks? This doesn't…
jusTravis
  • 23
  • 3
0
votes
0 answers

How to not have a "/" character in a hashed string?

I am trying to generate a reset password link for my web application and have thought of hashing timestamp+useremail+password with a secret string and then the hashed string would be unique for each user who wants to reset their password. But the…
Krash
  • 2,085
  • 3
  • 13
  • 36
0
votes
1 answer

Injecting $location service makes my url with fragment identifier weird

Here is my angular code var app = angular.module('app', []); app.controller('mainController', ['$location', '$scope', '$log', function(location, scope, log) { log.info(location.path()); }]); And this is my html
0
votes
0 answers

How to use location hash to simulate browsing to different pages with JQuery?

I'm trying to make a simple example in order to better understand the capabilities of the location hash. Essentially, I created a page with a button. Every time you press the button a new button is added and a new hash is added to the base url. The…
João Paiva
  • 1,937
  • 3
  • 19
  • 41
0
votes
1 answer

Can I force WebKit browsers to show the fragment identifier?

I'm using jQuery and the fragment identifier to create a state change depending on which part of a one-page site the user is currently looking at. I've finally got this to work but as both Safari and Chrome won't display the fragment identifier I…
Ian
  • 163
  • 2
  • 7