Skip to content

Instantly share code, notes, and snippets.

@mdobson
Created September 17, 2014 19:17
Show Gist options
  • Save mdobson/55f02ffca13c98eb5569 to your computer and use it in GitHub Desktop.
Save mdobson/55f02ffca13c98eb5569 to your computer and use it in GitHub Desktop.
Sample url parse fix
var serverPath = '/servers/' + server.id;
if(url.indexOf('/', url.length - 1)!== -1) {
url = url + serverPath;
} else {
url = url.slice(0, url.length - 1) + serverPath;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment