Created
October 6, 2012 21:06
-
-
Save sochoa/3846128 to your computer and use it in GitHub Desktop.
Backbone.js > Invalid URL Redirect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (/^\/.+/.test(window.location.pathname)) { | |
if (!/^(\/#)/.test(window.location.pathname)) { | |
console.error("Invalid URL: " + window.location); | |
window.location = '/#' + window.location.pathname; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment