window-location-origin

Add support for browsers that don't natively support window.location.origin

window-location-origin.js

Add support for browsers that don't natively support window.location.origin

window.location.origin
// #=> https://github.com/kylewelsby/window-location-origin
bower install window-location-origin
npm install window-location-origin

Stackoverflow discussion: JavaScript/jQuery method to find base URL from a string