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