I've recently seen a few links used without a protocol. It didn't seem too difficult to understand - I think it's a great idea and pretty intuitive.
For those of you unaware, using a URL like //example.com/script.js
will point to either http://example.com/script.js
or https://example.com/script.js
depending on whether or not the URL originates from a http or https URL. Including http scripts or images from a https page can be a security concern, for example, so this solves that without the need for protocol detection in your code.
My question is, what sort of browser/OS support is there for it? Is it safe to use in production? It would certainly make things a bit easier.
Simple example and test:
http://codetester.org/916c6916
EDIT:
Just a follow up that I've been using this for my company's ad server in production for many things without issue for a couple years now.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…