Skip to content

Instantly share code, notes, and snippets.

@englishextra
Created September 7, 2016 17:39
Show Gist options
  • Save englishextra/2a7fdabd0b23a8433d5fc148fb788455 to your computer and use it in GitHub Desktop.
Save englishextra/2a7fdabd0b23a8433d5fc148fb788455 to your computer and use it in GitHub Desktop.
A fix for window.location.origin in Internet Explorer
/*!
* Internet Explorer does not have access to window.location.origin
* tosbourn.com/a-fix-for-window-location-origin-in-internet-explorer/
*/
if (!window.location.origin) {
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment