It depends on whether the CDN has a secure version of the resource you are requesting. Google seems better than Yahoo! from what i saw.
You can use non-protocol links to CDN resources, as shown below:
Works with http or https:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
Only works with http:
<link rel="stylesheet" type="text/css" href="//yui.yahooapis.com/3.8.0/build/cssreset/cssreset-min.css" />
You can also conditionally load scripts from CDN and return to local versions:
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js"> </script> <script> !window.jQuery.ui && document.write( unescape('%3Cscript src="/scripts/jquery-ui-1.8.14.min.js"%3E%3C/script%3E')) </script>
source share