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())
}
Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

No Reader comments

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!