Using a protocol-independent absolute path
Snippet
Instead of being asleep at 22:21 on 13 November 2010, kitt created this:
If the browser is viewing an page in SSL through HTTPS, then it’ll request that asset with the https protocol, otherwise it’ll request it with HTTP.
<img src="//domain.com/img/logo.png"/>
Use the // ignoring the protocol.
Add new comment