What is the effect of a double slash//Start URL in img?

Source: Internet
Author: User

I do not know if you have seen the following URL to the wording:

The URL in img starts with a double slash "//", which has a special purpose that determines whether the current page protocol is HTTP or HTTPS to determine the protocol that requests the URL. Prevent the "This Page Contains Both Secure and non-secure Items" error in IE.

But when you browse the local file, it resolves to the file://protocol. This feature can be used to load CDN:

Also applies to CSS:

. omgomg {Background:url (//lvtao.net/lvtao.gif);}

Note: If you use and @import to introduce CSS in IE7,IE8, you will download the CSS file two times.

Reference: http://www.paulirish.com/2010/the-protocol-relative-url/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.