Home > Web Front-end > HTML Tutorial > html资源地址 src="// 开头_html/css_WEB-ITnose

html资源地址 src="// 开头_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:26:53
Original
840 people have browsed it

如果浏览器当前使用的是https协议,那么就加载https协议的脚本,否则使用http,这保证了页面所有资源使用同一协议。其实是有人将其做为规范来实践的。另外包括图片地址,CSS中的background地址都可以省略协议名。在script标签上使用没有兼容性问题,但在link上或者@import上这样写IE下会有问题。更多请参考:http://www.paulirish.com/2010/the-protocol-relative-url/
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template