fragment-identifier

Encoding of window.location.hash

Does window.location.hash contain the encoded or decoded representation of the url part? When I open the same url (http://localhost/something/#%C3%BC where %C3%BCtranslates to ü) in Firefox 3.5 and Internet Explorer 8, I get different values for document.location.hash: IE8: #%C3%BC FF3.5: #ü Is there a way to get one variant in both...

Getting URL hash location, and using it in jQuery

Heya guys. I'd like to get the value after a hash in the URL of the current page and then be able to apply this in a new function... eg. The URL could be www.example.com/index.html#foo And I would like to use this in conjunction with the following piece of code $('ul#foo:first').show(); I'm kinda assuming/hoping there is some...

Change hash without reload in jquery

Hello, I have the following code:- $('ul.questions li a').click(function(event) { $('.tab').hide(); $($(this).attr('href')).fadeIn('slow'); event.preventDefault(); window.location.hash = $(this).attr('href'); }); This simply fades a div in based on when you click but i want the page url hash tag to change when you click so people...

Get URI fragment (hash) to affect SEO? Get indexed by SEs?

I am building a forum site where the post is retrieved on the same page as the listing via AJAX. When a new post is shown, the URI fragment is changed (ex: .php#1_This-is-the-first-post). Also the title and meta tags are changed. My question is this. I have read that search engines aren't able to use #these-words. So therefore, my entir...

Javascript anchor navigation

I am creating a website with the "anchor navigation" like used with facebook and google mail. I have got it working but not fully. When I load the page with something like #contact it won't load it in unless I click the link for it. Also, would there be a better, more efficient way to do what I am doing? I am not the best person with JS ...

retrieve the hash in the url with php?

someone here in SO told me that the hash (#) in the url could be retrieved by php function parse_url? is this true? my web site got a lot of ajax effects and i want to be able to pass an url with a hash to the index.php so it could display the information based on the hash values. eg. if a user clicks and navigates in my website and he...

Response.Redirect with a fragment identifier causes unexpected refresh when later using location.hash

Hi All, I was hoping someone can assist in describing a workaround solution to the following issue I am running into on my ASP.NET website on IE. In the following I will describe the bug and clarify the requirements of the needed solution. Repro Steps: User visits A.aspx A.aspx uses Response.Redirect to bring the user to B.aspx#house...

URL fragment identifier - simplify state handling (javascript)

I have a web application which makes extensive use of the fragment identifier for handling "state". examplesite.com/#$mode=direct$aa;map=t;time=2003;vid=4;vid=7 A number of questions: 1) What is a good way of assigning the various "location.hash name value-pairs" to variables to keep track of the state? 1a) Should I make an object t...

Handle URL anchor change event in js

How can I write the JavaScript callback code that will be executed on any changes in the URL anchor? For example from http://example.com#a to http://example.com#b ...

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 dash #) from a Django view and so, I suppose, from a Django Request object? I've not found enough information on the documentation here available: http://docs.djangoproject.com/en/dev/ref/request-response/ P.S. Suppose that the fragment part is sent to the ...

URL Fragment and 302 redirects

It's well known that URL fragment (the part after the #) is not sent to the server. I do wonder however how fragments work when a server redirect (via HTTP status 302 and Location: header) is involved. My question is really two-fold: A: If the original URL had a fragment (/original.php#foo), and a redirect is sent to /new.php, does the...

Generating a link containing a fragment with ASP.Net MVC Routelink

I'm trying to use Html.RouteLink within a view to generate a link to a named anchor on another page. There's a few definitions for RouteLink that include a fragment option but I'm trying to figure out if there's another way. public static string RouteLink( this HtmlHelper htmlHelper, string linkText, string routeName, st...

Remove hash without page jump

Is it possible to remove the hash from window.location without causing the page to jump-scroll to the top? I need to be able to modify the hash without causing any jumps. I have this: $('<a href="#123">').text('link').click(function(e) { e.preventDefault(); window.location.hash = this.hash; }).appendTo('body'); $('<a href="#">').t...

Can you use hash navigation without affecting history?

I'm afraid it might be impossible but is there a way to change the hash value of a URL without leaving an entry in the browser's history and without reloading? Or do the equivalent? As far as specifics go, I was developing some basic hash navigation along the lines of: //hash nav -- works with js-tabs var getHash = window.location.hash...

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 with the url hashing. mydomain.com/#home mydomain.com/#aboutus mydomain.com/#register Wha...

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&amp;productPolicyId=7841#a1 When Javascript is enabled i don't want the hash value on the end so how do i remove it? When Javascript is disabled it needs to be present. Thanks. ...

How to get back button to work with anchors (#) and iframes

Hi, I am working on a site where the main part of it is driven by an ajax style navigation system using anchors in the url to define the application state. On top of this I now need to support IFrames that are loaded on top of this application. The problem I'm having is that the back button breaks if I make use of fragments. I've creat...

URL issues, after a link is clicked on via email -- What's the deal? ##

My app is sending users email with the following: https://blah.chacha.com/feedback/##comment-reply-169 But for some reason, sometimes when the URL is loaded in some of the user's browsers the ## are being converted to something like: https://blah.chacha.com/feedback/#%23comment-reply-169 Any ideas what's going on here and why? ...

Browser history back with scrollable div

When I Jump to section 1 & 2 everything works fine, and the browsers I tested (IE8, FF3.6, Chrome 5.0.342.3) scrolls down to the respective anchor in the div. But when I press the browser history back button the div won't scroll back up. Is there some way to make this work without using javascript ? <div id="scrolldiv" style="overflow:...

Redirect url to # (anchor)

I have a site that I just converted to use anchor navigation.. hwww.site.com/shows is now www.site.com/#shows It loads the info from the /shows directory to a div and adds the hash tag to tell you where you are. The problem is, if you go to www.site.com/shows, the content is still there, but unstyled. How can I get it to redirect wit...