In some of my E-Commerce applications I've started using src="//domain.com/file.js"
in cases where I needed to reference externally hosted scripts that I wanted to include. In my E-Commerce applications not all pages actually use https
as not every page has a form.
I'm wondering if there's really any disadvantage to always using this, as it's also a shortcut to http
and you can always, always avoid the not-secure IE warning.
If your intent is to load the resources from the same protocol as the page is loaded with, then using it is a perfect way to accomplish it. However, you may need to load some resources from http
even when your page is currently served under https
(let's say the resouce is served only on http
or you prefer to reduce load on your server by not making it encrypt every image on the page). In that case, you need to explicitly specify the protocol name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With