This basically allows the browser to determine whether to use http: // or https: // based on the protocol used by your page. If your page is on https, it will use https to receive scripts. Because if you are hard-coded to say http, and the page uses https, the browser will throw errors telling the user that the site may be unsafe, for example. The bottom line always uses the relative URL for scripts, images, and all resources and does not hardcode the http protocol.
source share