1

I am considering replacing querystrings with hashbangs on my public site, for better performance.

Are menus like Superfish compatible with the hashbang? How can I trigger a content update when I click a menu item where only the hash part is different?

Christophe
  • 27,383
  • 28
  • 97
  • 140
  • Before you implement hashbangs, [read this](http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs). – Hal Nov 27 '11 at 19:20
  • Well, I'll need more serious arguments to reconsider using hashbangs... – Christophe Nov 27 '11 at 20:00
  • 1
    I suggest you to use `pushState`. Much cleaner URL's, better history management. But you have to use `history.js` or something for browser compability. Regarding your question; You have to check documentation of your menu script if it's compatible with hashbang. You didn't specify which menu script you're going to use. – Emre Erkan Nov 27 '11 at 20:35

1 Answers1

1

If you are allready using jQuery on your site, i'll suggest taking a look at jQuery.address. It has a simple Interface and supports hashes and pushState. Keep in mind that you are going to have to change a lot of your serverside code when switching from querystrings to ajax calls.

ProTom
  • 1,194
  • 7
  • 7
  • Thanks for the suggestion. This plugin looks big, but I'll take a look. Actually I consume the querystrings on the client side so it's not such a big deal. My main concern is that a querystring change triggers an action (page refresh), while my page scripts won't notice a hash change. – Christophe Nov 27 '11 at 22:35