Created
September 12, 2011 11:02
-
-
Save fukata/1211019 to your computer and use it in GitHub Desktop.
jsunit utility
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
function base_url() { | |
var url = window.location.href; | |
var idx = url.lastIndexOf('/'); | |
if (idx > 0) { | |
url = url.substr(0, idx); | |
} else { | |
url = ""; | |
} | |
return url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment