Last active
August 29, 2015 14:03
-
-
Save sota1235/fa2a6d7f446c8459517d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function getRedirectPageUrl() { | |
| var url = location.hash.substring(1); | |
| console.log(url); | |
| try { | |
| if(url.length === 0) return "/"; | |
| url = decodeURIComponent(url); | |
| if(!url.match(/^https?:\/\//)) return "/"; | |
| } catch(e) { | |
| console.log("invalid url"); | |
| } | |
| return url; | |
| } | |
| /* ... */ | |
| var url = getRedirectPageUrl(); | |
| console.log(url); | |
| location.href = url; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment