What I want is do this:
var siteBaseUrl = window.location.origin;
But in IE 9 it's returning undefined
Trying to understand how do I use modernizr from the suggestion here:
$window.location.origin gives wrong value when using IE
I updated my code to add this block before my siteurl:
if (!window.location.origin) {
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
}
var siteBaseUrl = window.location.origin;
So now the above works, but I am not sure if modernizr suggestion in the link above can help me do it differently.
Or may be I am confusing myself and the above code is working due to modernizr.