Why do both these work when embedding a video iframe in a Rails application?
<iframe src="//player.vimeo.com/video/...>
and
<iframe src="https://player.vimeo.com/video/...>
Please enlighten me. I've seen it both ways. Which is preferable?
Why do both these work when embedding a video iframe in a Rails application?
<iframe src="//player.vimeo.com/video/...>
and
<iframe src="https://player.vimeo.com/video/...>
Please enlighten me. I've seen it both ways. Which is preferable?
Using //
infers the protocol from the URL from which the root page is served. Navigating to a site https://yoursite.com
would mean all //
links would also be served using HTTPS. This can be helpful if you're running the same page in a local environment that is using HTTP, and don't want to change it when pushing it to a production environment served using HTTPS.