URL of the URLs dependency protocol with double slash//start

Source: Internet
Author: User

Original: URLs-dependent protocol URL with double slash//

I wonder if you have seen the following URL notation:img URL is double slash "//" At the beginning, this notation has a special purpose, and it will determine whether the current page protocol is HTTP or HTTPS to determine the protocol of the request URL. Prevents the "This page Contains Both Secure and non-secure Items" error from appearing under IE. 

But when you browse local files, it resolves to file: // agreement. This feature can be used to load CDN:<script src= "//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js" ></script> also applies to css:.omgomg {Background:url (///websbestgifs.net/kittyonadolphin.gif);} Note: If you use <link> and @import to introduce CSS in IE7,IE8, two CSS files will be downloaded. Reference: http://www.paulirish.com/2010/the-protocol-relative-url/

URL of the URLs dependency protocol with double slash//start

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.