Skip to content

Comment on Screw Hashbangs: Building the Ultimate Infinite Scroll

Comments

This post motivated me to figure out how to hack pushState support into NewTwitter:

    twttr.secrets.html5Routing = true;
    twttr.router._changeUrlAndCallAction = function(p) {
        return twttr.Router.prototype._changeUrlAndCallAction.call(this, p.replace("#!/", ""));
    }
    twttr.router._changeUrlAndCallAction(window.location.hash);
Turns out they already have pushState() support... but it uses fragment URLs. This code just enables it, and wraps one of the functions to strip the "#!/".

https://gist.github.com/996381

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.