JavaScript
Article
By Sam Deering

Gumby2 Backbone IE8 Web App Fixes

By Sam Deering

In this post i’ll list any fixes which may help you if your using Gumby2 framework with Backbone. I’ll add more as I find them…

Override a button click in IE8

if (Gumby.isOldie) {
    var referLink = document.createElement('a');
    referLink.className = "skiplink";
    referLink.href = "#entry";
    document.body.appendChild(referLink);
    referLink.click();
}
else
{
    window.location.href = "#entry";
}

Hard page refresh for IE8

//hard refresh for IE8
if (Gumby.isOldie && document.referrer == "")
{
    window.location = '/#register';
}

In your backbone router:

Backbone.history.start({ pushState: Modernizr.history, silent: true });
if(!Modernizr.history) {
    var rootLength = Backbone.history.options.root.length;
    var fragment = window.location.pathname.substr(rootLength);
    Backbone.history.navigate(fragment, { trigger: true });
} else {
    Backbone.history.loadUrl(Backbone.history.getFragment())
}
Recommended
Sponsors
Get the latest in JavaScript, once a week, for free.