Skip to content

Instantly share code, notes, and snippets.

@FrankFang
Last active August 29, 2015 14:26
Show Gist options
  • Save FrankFang/e9bd8d1ba20e34f7aa4b to your computer and use it in GitHub Desktop.
Save FrankFang/e9bd8d1ba20e34f7aa4b to your computer and use it in GitHub Desktop.
window.location.origin IE fix
if (!window.location.origin) { // Some browsers (mainly IE) does not have this property, so we need to build it manually...
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