Skip to content

Instantly share code, notes, and snippets.

@baniol
Created March 17, 2014 07:54
Show Gist options
  • Save baniol/9595455 to your computer and use it in GitHub Desktop.
Save baniol/9595455 to your computer and use it in GitHub Desktop.
get base from a url
var loc = location.href;
var baseurl = loc.substring(0,loc.lastIndexOf('/'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment