0

I'm seeing these kind of script includes on third party sites all the time these days, for example, for the Google Maps API:

<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=false"></script>

What does this prefix of '//' mean ? That it uses whatever protocol the user is running (http, https)?

4

1 回答 1

1

是的,这意味着使用与加载页面相同的协议 - http 或 https

这样做是为了在通过 SSL 查看时不会收到有关加载“不安全”内容的警告

于 2013-05-18T10:03:54.173 回答