So, I was in a predicament recently where I needed to request a secure url if I was on a secure page and a non-secure url otherwise. Unfortunately, this was on a remote server so I needed to use a protocol, or so I thought (I couldn't just do something like this/that/myfile.js). So, I tried just not putting a protocal, and voila! It just used whatever protocol the current page was using. This is very cool, but I just want to make sure there is no downside to this. Anything anybody knows of that is wrong with doing this?
Code: Select all
<script type="text/javascript" src="//www.example.com/scripts/some-script.js"></script>