What is the difference between http: // and // in web development?

Possible duplicate:
Can I change all my links only to //?

I recently ran into this problem while scrolling the markup for a Google 404 page. In it they use // at the beginning of their URLs, in anchors in the markup, and also refer to / etc images in their CSS.

Since this is not what I met before, and given that Google is known for its optimization with finite granularity, I thought I would ask here and see if anyone has more information about using // instead of http: // this is not something that can be easily googled to find the answer.

I know that // is useful in applications where either http or https can appear, but are there other benefits besides this? Is it supported by all browsers? Are there any usage restrictions? Is it new / old?

I would be very interested if anyone has any information.

+4
source share
3 answers

//: "Regardless of the current protocol."

On the page served through http, this http://, and on https - https://.

+12
source

The only drawback I could find is this:

http://www.stevesouders.com/blog/2010/02/10/5a-missing-schema-double-download/

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

..

URL- . ,

http://stevesouders.com/images/book-84x110.jpg

//stevesouders.com/images/book-84x110.jpg

.

..

, Explorer 7 8 , , URL- . , .

Wireshark IE8, .

, -, // CSS.

+6

// - URL-, . http https .

There is a good explanatory article on why you would like to do it here: http://encosia.com/2011/01/19/cripple-the-google-cdns-caching-with-a-single-character/

+3
source

All Articles