Internet Explorer will download CSS files twice, if referenced via scheme-less URLs

Posted . Visible to the public.

You can use scheme-less URLs (or protocol-relative URLs Show archive.org snapshot ) to have browsers use the current protocol (HTTP or HTTPS) when loading content referenced with such an URL.

A protocol relative URL doesn’t contain a protocol. For example, http://stevesouders.com/images/book-84x110.jpg becomes //stevesouders.com/images/book-84x110.jpg

Browsers substitute the protocol of the page itself for the resource’s missing protocol. Problem solved!

But:

Internet Explorer 7 & 8 will download stylesheets twice if the http(s) protocol is missing.

So if you are working on a publicly accessible site, you can't use it for your stylesheet tags. Everything else works, though.

Arne Hartherz
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2012-10-30 07:39)