Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is a protocol relative url. This way if you are looking at the site over https then the assets will also come down over https.


I was pondering today why no-one really knows about or even uses it.

As a bit of a general question to everyone, did old browsers not support it or something? Or do people prefer using relative urls over absolute style ones?


Paul Irish blogged about it a while ago http://paulirish.com/2010/the-protocol-relative-url/


For those interested, the reason the old google analytics snippet wasn't using this instead of document.write:

There is an edgecase bug in IE6 that causes a dialog to blow up… under some security settings (unsure if they are default) when requesting form the non-'ssl' subdomain

So looks as if it's fine to use if you're not supporting IE6.

The new GA snippet uses different domains for the two modes so it can't be used.


I had to be told, years back, so I think it's just an assumption.

Also, for those pesky secured sites that have unsecured static assets on a separate server, it might be that those servers aren't configured for SSL.


No point in that configuration though as your browser will report the site as insecure.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: