Created
May 8, 2019 17:05
-
-
Save tyom/2cd85166375763e15c855b617111c327 to your computer and use it in GitHub Desktop.
This is technique is useful when dealing with static subdirectories. Unless the current directory has trailing slash it won't be regarded it as such, leading to wrong relative path.
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
window.location.href.match(/[^/]$/) && (window.location.href += '/'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment