Last active
February 22, 2016 17:13
-
-
Save casperwilkes/d177e774641962907639 to your computer and use it in GitHub Desktop.
Simple javascript redirect function. Inline and included
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
| // Inline // | |
| window.location.replace('location/to/redirect.html'); | |
| // Functions.js // | |
| /** | |
| * Redirects user to specified location. | |
| * @param {string} redLocation Location to send user to | |
| * @returns {void} | |
| */ | |
| function redirect(redLocation) { | |
| if (redLocation !== 'undefined') { | |
| location.href = redLocation; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment