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
29
votes
1 answer

How to access url hash/fragment from a Django Request object

As in the title: How can I access the URL hash/fragment (the part following the hash #, or 'pound symbol' in US English) from a Django view and so, I suppose, from a Django Request object? I've not found enough information on the documentation here…
Andrea Zilio
  • 4,444
  • 3
  • 29
  • 34
28
votes
5 answers

Keeping history of hash/anchor changes in JavaScript

I'm currently implementing a JavaScript library that keeps track of the history of changes to the hash part in the address bar. The idea is that you can keep a state in the hash part, and then use the back button to go back to the previous state. In…
Blixt
  • 49,547
  • 13
  • 120
  • 153
27
votes
5 answers

Why is "#.id" a bad selector in CSS/jQuery yet it works in an HTML anchor?

I'm using JSDoc. It generates ids with a period as in If another part of the page has That works perfectly. Clicking the second anchor scrolls to the first. But, neither…
gman
  • 100,619
  • 31
  • 269
  • 393
26
votes
4 answers

window.location.hash = " "; prevent scrolling to the top?

in my website i set the url adress using window.location.hash = 'project_name'; but if i want to clean the adress url from any hashes (when i close a project) and i set window.location.hash = ''; it happens the page scrolls up to the top…
Francesco
  • 24,839
  • 29
  • 105
  • 152
26
votes
2 answers

URL fragment (#) allowed characters

After some digging on the internet I was unable to find a good answer to which characters I may use for URL fragment. I'm writing a javascript-script that will take advantage of URL fragments. I wanted to make the URL eye-friendly by not having it…
Qlii256
  • 460
  • 6
  • 11
23
votes
6 answers

What's the best library to do a URL hash/history in JQuery?

I've been looking around JQuery libraries for the URL hash, but found none that were good. There is the "history plugin", but we all know it's buggy and isn't flexible. I am loading my pages inside a div. I'll need a way to do back/forward along…
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
23
votes
1 answer

Multiple parameters in URL fragment

Is there a standard format that allows for multiple parameters to be specified in the URI fragment? (the part after the hash #, not the query string.) The most related information would be this question: Multiple fragment identifiers correct in…
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
22
votes
1 answer

Apache rewrite rule for a destination containing a hash mark

I'm trying to issue a redirect where the destination contains a fragment-identifier part. I tried with this rule: RewriteRule ^/foo/bar/([^/]+)/(.*)$ /cgi/script#foobar::$1.$2 [R,L] However the # is converted into %23 and the web application…
ascobol
  • 7,554
  • 7
  • 49
  • 70
20
votes
4 answers

Bootstrap Collapse - open the given id fragment

Imagine a Bootstrap collapse with 3 parts
...
...
...
Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307
19
votes
4 answers

What does #/ means in url?

I am working on ROR web apps. My webpage url looks like below- http://dev.ibiza.jp:3000/facebook/report?advertiser_id=2102#/dashboard Here I understood that advertiser_id is 2102 but I couldn't understand what #/dashboard is pointing to?
RajSharma
  • 1,941
  • 3
  • 21
  • 34
17
votes
2 answers

Get the hashchange event to work in all browsers (including IE7)

I have some code (written by another developer) that is doing AJAX page loading inside of WordPress (e.g. no page reloads) when you click a nav item, AJAX refreshes the primary content area. My problem is that it's broken in IE7 and I have no idea…
Brian
  • 3,920
  • 12
  • 55
  • 100
17
votes
4 answers

jQuery removing hash value from URL

I have a hard coded URL like so: https://bupacouk.bwa.local.internal.bupa.co.uk/cash-plan-quote/quoteAction.do?getBenefitLevelDetails=getBenefitLevelDetails&productPolicyId=7841#a1 When Javascript is enabled i don't want the hash value on the end…
RyanP13
  • 7,413
  • 27
  • 96
  • 166
17
votes
2 answers

How to get the URL fragment identifier from HttpServletRequest

How do I get the URL fragment identifier from HttpServletRequest? The javadocs doesn't seem to mention it.
Kurru
  • 14,180
  • 18
  • 64
  • 84
16
votes
5 answers

Retrieve the fragment (hash) from a URL and inject the values into the bean

I am looking for a way to inject values from the fragment (#) of a URL into bean(JSF), in the same way query-parameter values are injected. I am using Ben Alman's Bookmarkable jQuery plugin (http://benalman.com/projects/jquery-bbq-plugin/) to create…
Choesang
  • 1,225
  • 1
  • 14
  • 23
15
votes
4 answers

Are there any javascript libraries for working with hashbang/shebang (#!) urls?

With all the negative press over Twitter and Gawker's use of hashbang urls I'm having a very hard time finding any examples/libraries for how to actually use them. I'd like to use hashbang urls in a javascript carousel on our website so we can link…
Twipped
  • 1,149
  • 12
  • 24
1 2
3
16 17