Kinda Relative URLs
After developing for *cough* some time it's not often that I come across a new style of URL that I've never even heard of before.
A few days ago I saw a forum post about a 404 message someone got about their geotrust smartseal badge. I followed up and found that the javascript that geotrust supply has a URL style that I've never seen before - note below that there is no protocol!
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" src="//smarticon.geotrust.com/si.js"></SCRIPT>
..and two leading //.
Then I noticed that the Authorize.net badge on the same page was very similar:
<script type="text/javascript" language="javascript"
src="//VERIFY.AUTHORIZE.NET/anetseal/seal.js" ></script>
Google wasn't helpful for this, but after asking around on some technical lists I got an answer from Adam Sills.
Look at http://www.webreference.com/html/tutorial2/3.html and you'll see that..
"A relative URL that begins with // (two slashes) always replaces everything from the hostname onwards."
You really can learn something every day. This is clever actually, because it means that no matter if your page is being requested as http or https the badges will be requested with the same protocol - meaning that you won't see any security warnings.
ASP.NET 3.5 Web Hosting: 3 Months FREE + FREE Setup - CLICK HERE!