Skip to content

Instantly share code, notes, and snippets.

@cj
Created February 21, 2011 17:34
Show Gist options
  • Save cj/837386 to your computer and use it in GitHub Desktop.
Save cj/837386 to your computer and use it in GitHub Desktop.
// Start the hash change handling, returning `true` if the current URL matches
// an existing route, and `false` otherwise.
start : function() {
var docMode = document.documentMode;
var oldIE = ($.browser.msie && (!docMode || docMode <= 7));
if (oldIE) {
this.iframe = $('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
}
if ('onhashchange' in window && !oldIE && ($.browser.msie || docMode >= 8)) {
$(window).bind('hashchange', this.checkUrl);
} else {
setInterval(this.checkUrl, this.interval);
}
return this.loadUrl();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment