The protocol-relative URL « Paul Irish
►http://paulirish.com/2010/the-protocol-relative-url
Une petite astuce que je ne connaissais pas :
There’s this little trick you can get away with that’ll save you some headaches:
<a href="//domain.com/toto.html">
If the browser is viewing that current page in through HTTPS, then it’ll request that asset with the HTTPS protocol, otherwise it’ll typically* request it with HTTP. This prevents that awful “This Page Contains Both Secure and Non-Secure Items” error message in IE, keeping all your asset requests within the same protocol.
Note : dans l’article original la balise HTML d’exemple est un <img>, mais #seenthis rajoute automatiquement le "http:" manquant devant.
Apparemment ça marche aussi avec file ://