Search code examples
jqueryhashchangejquery-address

change the look of the hash in the hashchange plugin


I'm currently using http://benalman.com/projects/jquery-hashchange-plugin/ and I noticed that my hashes show up as "/#page" rather than "/#/page" Im trying to copy the look from jQuery Address. But the reason I can not use Asual is because it doesn't have a trigger event like the hashchange plugin does.

current setup:

$j(window).bind('hashchange', function(e) { 
   run w/e functions here
});

load json objects

$(window).trigger('hashchange');

I noticed in jQuery Address there is a return on the click selector. Maybe I need something like that?


Solution

  • There is nothing special about the extra / in the url.

    Just put it in the anchor like normal: <a href="#/page">

    Or when manually setting the hash: location.hash="/page"