Created
August 7, 2015 14:28
-
-
Save craigbutcher/afbfa7f37a39df1781c0 to your computer and use it in GitHub Desktop.
Checking for spaces and replacing them with HTML URL encoding %20
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
// Get the href path | |
var path = linkClicked.attr('href'); | |
// Does it contain spaces? If so, convert them to HTML URL Encoding Reference - %20 | |
path = path.replace(/ +/g, '%20'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment