javascript check https or http code example Example: check if url is http or https javascript You can make use of `window` keyword => window.location.protocol