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
0 answers

Force page reload on browser back when the fragment identifier changes

Problem: 1.User clicks on this link: default.aspx#id=1. 2.The page loads, the JS from the page gets the fragment identifier (in this case id=1), and then it posts back and loads some content based on that id. 3.User then clicks on the next link:…
osmiumbin
  • 329
  • 2
  • 6
  • 15
0
votes
2 answers

Make Firefox refresh after changing fragment from an iframe

My code is in an iframe from a different domain, and I want to trigger a page refresh on the parent after changing the fragment of the URL (also of the parent). It happens on IE, but not on Firefox. Is there any way of doing it without changing the…
Victor
  • 9,210
  • 3
  • 26
  • 39
0
votes
1 answer

Do something when browser back button is pressed when there is a hash

I am trying to get an alert to fire when I press back to get to a page from a hash. I'm using the following code if(window.location.hash) { } else { alert('test'); } If I'm at http://someurl.com/#somehash and I press the browser back button to…
Martin Hunt
  • 1,135
  • 2
  • 14
  • 23
0
votes
1 answer

How to correctly display a panel in HTML?

I'm building a HTML5 game consisting of a full window canvas. I want to occasionally display a panel over the canvas, for displaying settings etc. One way of achieving this would be to have a
which is hidden by default and…
Jamie Fearon
  • 2,574
  • 13
  • 47
  • 65
0
votes
2 answers

301 Redirect without fragment

Possible Duplicate: URL Fragment and 302 redirects I need to help regarding the 301 Redirect without Special character. For example, I want to redirect the following URL: http://www.example.com/iphone-ipad-mobile-apps-portfolio.html#Gigguid To…
Chetan
  • 44
  • 5
0
votes
1 answer

Remove Fragment Identifier on 302 Redirect

I have a page with a form at the bottom. I use a fragment identifier in the form action, because the form re-displays on post when there are errors, and I don't want the user to have to scroll down to it to make corrections. When the form is…
Sonny
  • 8,204
  • 7
  • 63
  • 134
0
votes
1 answer

Call javascript function based on Fragment ID

Please dont ask why I would want to do this, I just want to know if it's possible to call a javascript function if and only if a specific fragment ID is present. Thanks :) (Yes this links with my previous question, but it was too dissimilar to…
Code Bundle
  • 282
  • 1
  • 2
  • 14
0
votes
2 answers

direct users to specific locations in page

I want to set up a menu to direct the user to the same page, but diffent locations
devmonster
  • 1,729
  • 8
  • 24
  • 48
0
votes
1 answer

Focus on footer form with hash/fragment keeps hash after successful submit

I have a form at the bottom of the page. It's a normal form. I've set the action to #adding-show and the form's id is "form". The result is that the form submits to the current page (the browser doesn't send #adding-show to the server). If the…
Rudie
  • 52,220
  • 42
  • 131
  • 173
0
votes
1 answer

Fragment ID or Tag in a ViewPager?

I am currently having a problem accessing a Fragment ID and Fragment Tag. I am currently implementing a Fragment in a TabHost and ViewPager, the new tab is added like this: mTabsAdapter.addTab(bar.newTab().setText("Tab0"), Tab0.class,…
0
votes
2 answers

Adding your own hash in the URL breaks jQuery Mobile?

I would like to use my own hash parameters in the URL, but when I do the jQuery Mobile site does not work any more. Just a blank white screen with an endless spinner. Is it true the hash is off limits to me when using jQuery Mobile?
TruMan1
  • 33,665
  • 59
  • 184
  • 335
0
votes
2 answers

How can an iframe change its parent's URL fragment (without causing a refresh)?

I'm trying to get a child JavaScript application to update it's parent document. In essence, this is a very simple problem: a JavaScript program opens an iframe in it's own document. another JavaScript program is loaded into the iframe. the second…
Paul W Homer
  • 2,728
  • 1
  • 19
  • 25
-1
votes
1 answer

Spring Java jumping anchor via fragment-identifier redirects to homepage

I've come across a strange problem in a Spring site where if you use jumping anchors, it redirects me to the homepage. For example, I have code like this (simplified);
gwnp
  • 1,127
  • 1
  • 10
  • 35
-2
votes
1 answer

Execute javascript based on # in target URL

when someone clicks an element that points to #checkoutID I'd like to execute a script. this is the element:
-2
votes
1 answer

Codeigniter : a href with hash not working in codeigniter

Im now developing a websites with a number of internal links present in each page. the project is in codeigniter. on some part of the html code , i used anchor links for internal linking like
Shifana Mubi
  • 197
  • 1
  • 3
  • 17
1 2 3
16
17