Created
September 28, 2015 17:12
-
-
Save blakewrege/dd062af35840d64e5c0b to your computer and use it in GitHub Desktop.
Fixes url base path
This file contains hidden or 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
<!-- Change base dependent on system --> | |
<p id="test"></p> | |
<script> | |
function urlpath() { | |
var hosts = window.location.href; | |
if (hosts.indexOf("brp9209") > -1) { | |
var strLink = "https://cs.wmich.edu/~brp9209/CS3500/"; | |
} else if (hosts.indexOf("pmp2439") > -1) { | |
var strLink = "https://cs.wmich.edu/~pmp2439/CS3500/"; | |
} else { | |
var strLink = "/CS3500/"; | |
} | |
return "<base href = " + strLink + " />"; | |
} | |
document.getElementById("test").innerHTML = urlpath(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment