Questions tagged [hashchange]

hashchange is a DOM window event that is fired when the URL's fragment identifier changes.

hashchange is a DOM window event that is fired when the URL's changes. Use this tag for questions related to this event and its related event handler onhashchange.

Resources

Related Tags

241 questions
5
votes
2 answers

IE 8 shows raw ajax response on page reloading with jQuery BBQ

I use Ben Almans's jQuery BBQ and jQuery hashchange plugins on pagination links. Both work as expected in Opera and Firefox but do not in IE 8 (surprised, huh?). IE also works good with ajax, back button and hashchange, but fails when I clicking the…
sunki
  • 672
  • 11
  • 20
5
votes
4 answers

Javascript : onHashchange Test

I'm trying to check if the browser supports onHashChange or not to hide some code from it if not, in this way: if(window.onhashchange){ ...code... } else { ...other code... } I tried this too: if(typeof window.onhashchange === "function"){ …
Adam Halasz
  • 57,421
  • 66
  • 149
  • 213
5
votes
1 answer

Routing in a Single Page Application with a different home page

I have a single page application - which means everything on the server gets redirected to a single index.html file which does the heavy lifting and routing using the HTML5 history api (pushstate). Now, I want to add a new landing page to the side -…
Benjamin Gruenbaum
  • 270,886
  • 87
  • 504
  • 504
5
votes
2 answers

Stop loading of images on a hashchange event via JavaScript or jQuery

I am using the jQuery BBQ: Back Button & Query Library plugin to create a page that pulls in dynamic content when a link is clicked. When the link is clicked the hash is changed and new content is pulled in (the 'default' action of clicking a href…
Justin Jenkins
  • 26,590
  • 6
  • 68
  • 1,285
5
votes
1 answer

Angularjs history support for IE6 and IE7

I am using routing in Angularjs for my SPA but I have to support IE7 (and IE8 in IE7 compatibility mode). I want the browser history to still work though. I don't care if I have to use a jQuery plugin.
5
votes
5 answers

When using back button AJAX results have been lost

So I've set up a pagination system similar to Twitter's where where 20 results are shown and the user can click a link to show the next twenty or all results. The number of results shown can be controlled by a parameter at the end of the URL…
dougoftheabaci
5
votes
1 answer

jsdom hashchange event

On a jsdom document: document = require('jsdom').jsdom(""); window = document.createWindow(); Changing its hash: document.location.href = '#bang'; doesn't trigger any 'hashchange' event on window Does…
abernier
  • 27,030
  • 20
  • 83
  • 114
4
votes
1 answer

IE makes extra GET-request on hash change

When I make an XMLHttpRequest, I also change window.location.hash. For example, mysite.com/gallery/q#1 becomes mysite.com/gallery/q#2. When this happens, IE8, as Fiddler and nginx logs show, makes this strange extra request to mysite.com/gallery/…
katspaugh
  • 17,449
  • 11
  • 66
  • 103
4
votes
4 answers

Enabling back/fwd key events for an Ajax Application

I have an application which works heavily on AJAX. However I want to have navigation functionalities in it. To spoof the url, I am changing the location.hash, to generate URL. But if I use back/fwd, only the url changes, but page wont reload. How…
Rakesh
  • 5,793
  • 8
  • 36
  • 37
4
votes
2 answers

DOMNodeInserted or hashchange

I am trying to write a JavaScript script that is "overlayed" on top of a Facebook page. It uses DOMContentLoaded to detect when content is loaded, then adds some extra stuff in. However, because Facebook doesn't actually "reload" the page when going…
jakey
  • 41
  • 2
4
votes
1 answer

Capture iFrame onhashchange event from the parent

I've being trying to capture the event onHashChange of an iFrame from his parent without success. So basically I'm doing: index.html - Approach 1: iframeEl = document.getElementById('myiframeid'); iframeEl.addEventListener('hashchange', function()…
Tito Facchini
  • 115
  • 2
  • 4
4
votes
0 answers

ReactJS - onhashchange vs addEventListener("hashchange")

I'm using a hashchange listener in my React component. The listener is mounted in componentDidMount() via onhashchange rather than using addEventListener() through the commented line. Is there a difference between the…
fractal5
  • 2,034
  • 4
  • 29
  • 50
4
votes
2 answers

Cross-domain hash change communication

Please consider the following two domains: domain1.com and domain2. From domain1 I open an iframe that points to domain2. Now, I want these guys to communicate with each other, which I've successfully accomplished by applying hash change event…
John
  • 251
  • 1
  • 3
  • 8
4
votes
2 answers

Does onHashChange work in Safari?

Does onHashChange or hashChange work in Safari? I tested it with Safari 4.0.4 on Windows 7 and it doesn't work for me. If it doesn't work, is there any solution to track if the hash has changed?
Adam Halasz
  • 57,421
  • 66
  • 149
  • 213
4
votes
2 answers

JavaScript .hashchange performance. Can it bring any slowdown?

jQuery hashchange event For me it looks like most mature solution right now(please correct me if I'm wrong). I really like this plugin for manipulating with browsers hashes. It simplifies js code a lot in some cases. I really want to start use it…
BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91
1 2
3
16 17