When is the protocol required in http/https requests URLs Are there any pros or cons of doing one way or the other? Whether or not it is absolutely required, is there a considered a best practice?
For instance, all of the following links are valid since if the protocol is not specified, it defaults to the current page request.
<img class="map" src="https://maps.google.com/maps/api/staticmap?markers=color" alt="Map" />
<img class="map" src="//maps.google.com/maps/api/staticmap?markers=color" alt="Map" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
Another similar application would be curl requests. I expect protocol is required, but am not certain.
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, "https://maps.google.com/maps/api/geocode/json?sensor=false&address=xyz");