I just started to test the idea behind "protocol less Urls".
The problem I´m looking to solve is: on a https page I need to load an external css file from http.
Doing this the "normal" way results in failure... the css file is blocked. (Just testing with chrome for now).
So my question is: Will "protocol less Urls" load the file from http/https/both?
If you're referring to URLs like www.example.com/style.css
, that won't work because the protocol is completely missing; a browser will treat www.example.com
as some kind of directory path name.
If you're referring to URLs like //www.example.com/style.css
, that is a protocol-relative URL; it uses the same protocol as what the browser is already using to request the referring page. For example, if the browser had requested a page with https://www.example.com
, then that URL will be requested over HTTPS and not HTTP.
Browser support for these URLs is generally pretty good; see the following questions:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With