Earlier quoted context omitted.
I've used this technique since 2006 or so with IE6. The only concern I know of relates to using odd port numbers without a protocol in IE (but I don't think this is a concern if the protocol is relative). At the time, every other browser tested worked as well (not that that was much of a shock). I don't have a copy of IE6 to test on at the moment, but what makes you think IE8 is required for relative protocols?
IE6 will also fetch some resources twice if they are protocol-relative URLs
"//" should indicate a URL
21–28 of 28 posts
Re: "//" should indicate a URL
#22URL detection is tricky because people omit the “ http://” part of URLs. It used to be that you could look for stuff beginning with “www.”, but nobody uses “www.” anymore, so now you basically have to have a list of TLDs and look for anything ending in “. ”. Now that everybody will be able to register their own TLD, will URL detection even be feasible for humans any more? I’ve been thinking about how we’re going to s…
Interestingly, http://dk/ has a valid A record to 193.163.102.24 which curl will show is a 301 redirect, but you cannot load it in Chrome or Firefox. dk has MX records too (I remember an old story about someone who had the email address m@dk or similar), but I think generally having any records for the top level is frowned upon now.
Re: "//" should indicate a URL
#23URL detection is tricky because people omit the “ http://” part of URLs. It used to be that you could look for stuff beginning with “www.”, but nobody uses “www.” anymore, so now you basically have to have a list of TLDs and look for anything ending in “. ”. Now that everybody will be able to register their own TLD, will URL detection even be feasible for humans any more? I’ve been thinking about how we’re going to s…
Except for the vast majority of high volume sites that know how to balance traffic and don't show "fail whales" every couple days.
Visit google.com, yahoo.com, amazon.com, msn.com, etc, and watch your URL get fixed to correctly reflect the local hostname "www".
Even coca-cola.com. You can type it wrong as you always have, and they'll fix it for you to be "http://www.coca-cola.com/.
Re: "//" should indicate a URL
#24Earlier quoted context omitted.
Conversely, the protocol bit is relevant whenever your link is not domain- or protocol-relative, or when you can't be sure. And you can't be sure . Here's why: if someone saves your page on their hard drive and you're using protocol-relative URLs, the implied "http" just became "file". (Which in fact may be a nice excuse for some clever hacks.) Test it yourself! Save the following snippet to your computer and see how…
You're assuming people care about that use case. I think in most cases it's irrelevant.
Re: "//" should indicate a URL
#25mirror: http://webcache.googleusercontent.com/search?q=cache:skyb.us...
Re: "//" should indicate a URL
#26Earlier quoted context omitted.
Conversely, the protocol bit is relevant whenever your link is not domain- or protocol-relative, or when you can't be sure. And you can't be sure . Here's why: if someone saves your page on their hard drive and you're using protocol-relative URLs, the implied "http" just became "file". (Which in fact may be a nice excuse for some clever hacks.) Test it yourself! Save the following snippet to your computer and see how…
HTML Base tag is your friend. http://www.w3schools.com/TAGS/tag_base.asp
http://dev.w3.org/html5/spec/Overview.html#the-base-element
And accordingly, adding `http://example.com/ >` to that test above seems to work well on modern browsers.
Re: "//" should indicate a URL
#27I assume that the author intends // to replace http:// , and that all other protocols such as ftp, https, etc. would still be written? If that's the case, why bother with the // at all? Why not just assume, as most browsers already do, that there's an inferred http:// at the beginning of whatever the user types in the address bar? (EDIT - I see that he's talking about how we would refer to URLs in things like print a…
Re: "//" should indicate a URL
#28Earlier quoted context omitted.
You're assuming people care about that use case. I think in most cases it's irrelevant.
Oh man. Are you really saying that corner cases are a priori negligible? That seems like a dangerous road to start down when you're discussing basic protocols!
I'm saying that those who need to worry about such things should and the rest of us should not. Nothing more and nothing less.