
"//" should indicate a URL - skybus
http://skyb.us/content/search-prefix-should-indicate-url
======
nbpoole
The // prefix is actually used for protocol-relative URLs. So //google.com
leads to <https://google.com> on a page with SSL, and it leads to
<http://google.com> on an unencrypted page.

See:

<http://nedbatchelder.com/blog/200710.html#e20071017T215538>

<http://paulirish.com/2010/the-protocol-relative-url/>

~~~
rufibarbatus
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 your
browser resolves the URL:

    
    
      <!DOCTYPE html>
      <title>Testing 1 2 3</title>
      <p><a href="//google.com/">Linky</a></p>

~~~
teyc
HTML Base tag is your friend. <http://www.w3schools.com/TAGS/tag_base.asp>

~~~
sleepyhead
W3Schools is not your friend. <http://w3fools.com/>

------
jaysonelliot
I 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 advertisements. Cute idea, but given the ubiquity of web addresses
in mass media, and the time it takes for the public to learn anything new, it
still sounds like a solution in search of a problem. The average American is
still not sure how Twitter works, or what it means when they see a @name or a
#tag.)

~~~
innes
Sorry for the meta-comment, but you seem to be the only person here who
actually got what the article was saying.

------
dbrock
URL 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 “.<tld>”. 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 solve this problem for a while, because
we need some kind of notation to replace “.<tld>”. I mean I don’t think people
will go back to writing <[http://coca-cola>](http://coca-cola>), so when I saw
the title of this post I immediately knew what the idea was: let’s write
//coca-cola to denote “the URL coca-cola”. (Unfortunately, both Google Chrome
and Safari interpret “//coca-cola” as “file:///coca-cola”.)

I don’t know why everybody is talking about the technical meaning of //coca-
cola, as that’s kind of irrelevant. Us web developers will of course still be
typing the full <http://coca-cola>, as we always have.

~~~
Terretta
> _nobody uses “www.” anymore_

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/>.

------
mukyu
Wouldn't load for me.

mirror:
[http://webcache.googleusercontent.com/search?q=cache:skyb.us...](http://webcache.googleusercontent.com/search?q=cache:skyb.us/content/search-
prefix-should-indicate-url&hl=en&strip=1)

------
jexe
It's funny, Tim Berners-Lee feels pretty much the opposite way:

[http://bits.blogs.nytimes.com/2009/10/12/the-webs-
inventor-r...](http://bits.blogs.nytimes.com/2009/10/12/the-webs-inventor-
regrets-one-small-thing/)

------
sliverstorm
I'm still not convinced anything is actually broken.

------
dedward
Throw in gratuitous use of srv records and i'll go for it

------
drivebyacct2
<http://www.google.com> and <https://www.google.com> have two entirely
different meanings when you get right down to it.

Plus `//` is already used as a protocol agnostic way of accessing resources in
HTML.

~~~
masklinn
Not protocol agnostic, protocol relative.

