Derek P. Collins

About

This is the personal blog of Derek P. Collins—a web developer working for KISSmetrics. Read more »

Follow

  • Twitter
  • Facebook

Work

  • KISSmetrics
  • KISSinsights

Using a protocol-independent absolute path

dropshadows:

Using a protocol-independent absolute path:

<img src="//domain.com/img/logo.png"/>

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.

— Paul Irish

As seen in this commit for HTML5 Boilerplate

We’ve been doing this lately and it’s very handy.

1 year ago ♥ 15

© 2010 Derek P. Collins