Created
December 15, 2016 06:44
-
-
Save EITANINOMIYA/8e27ea30614d675c978b57c18cd22021 to your computer and use it in GitHub Desktop.
【javascript】現在開いている画面のドメイン名までを取得
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
/*################################################# | |
# IE10以下にも対応出来るように、originがない場合も対応 | |
#################################################*/ | |
var origin = location.origin ? location.origin : location.protocol + "//" + location.hostname; | |
console.log(origin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment