Created
August 3, 2018 10:18
-
-
Save jcamp/af18ba7e54602b2c9ddd660a03e6828d to your computer and use it in GitHub Desktop.
Check and set js variable if running http or https
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
var isHttps = location.protocol.match(/https/); | |
var http = isHttps ? 'https://' : 'http://'; | |
var site_url = http + location.host + '/webpage'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment