1

as I strive to come up with the best methods name in my designs I struggle on a simple question but still very confusing to me.

There are two ways I use for retrieving stylesheets or javascript files:

<link href="/myProject/public/styles/master.min.css?v=1274382274" media="screen"    rel="stylesheet" type="text/css" />
<link href="http://mydomain.com/public/styles/master.min.css?v=1274382274" media="screen"    rel="stylesheet" type="text/css" />

<script type="text/javascript" src="/myProject/public/scripts/master.min.js?v=1274394222"></script>
<script type="text/javascript" src="http://mydomain.com/public/scripts/master.min.js?v=1274394222"></script>

I know that http://[...] can be called as an URI (as specified by the difference between URI and URL)

but an href or src that specifies a path according to the document root of the server such as /myProject/public is different.

So what would be the best term when speaking of those two different href|src value's?

/myProject/public/[...]
http://mydomain.com/[...]
  • An URI since it specifies a location and an identification?
  • An URL? Not sure why
  • A path? A definitive no IMO
  • Another term, please specify and explain

My design is independant of both the href and src, otherwise I would just have used the two terms href and src, of course. So in summary, I need the term that specifies the above while speaking about both about the href and src.

Thanks!

Community
  • 1
  • 1
Steven Rosato
  • 2,174
  • 1
  • 21
  • 32
  • 1
    I believe the linked question perfectly answers your question. Nothing more to say. All URLs are URIs but not vice versa. Both of the examples you wrote all URLs (and consequently URIs too). The first is a relative URL and the second is an absolute URL. Both are URLs as they *locate* a resource. URNs are, for instance, URIs but not URLs. They identify a resource but provide no means to locate it. http://en.wikipedia.org/wiki/Uniform_Resource_Name – Mehrdad Afshari May 21 '10 at 14:27
  • @Mehrdad Thx a lot, you could put that as an answer so I can tag it as answered. After further checkup, this makes perfects sense. Thanks a lot. – Steven Rosato May 21 '10 at 15:38

2 Answers2

2

I believe the linked question perfectly answers your question. Nothing more to say. All URLs are URIs but not vice versa. Both of the examples you wrote all URLs (and consequently URIs too). The first is a relative URL and the second is an absolute URL. Both are URLs as they locate a resource. URNs are, for instance, URIs but not URLs. They identify a resource but provide no means to locate it.

Mehrdad Afshari
  • 414,610
  • 91
  • 852
  • 789
1

What is hidden by a definitional approach (i.e. "every A is B") is that the "URI vs URL issue" is indeed historical.

The term "URL" was used in specifications only for a few years. However this was exactly the years where the Web became popular. So everybody learnt about "URLs", "sites", "pages", "addresses", and even if the W3C strived for erasing these questionable terms and concepts from people minds, the harm was done.

Aurélien Bénel
  • 3,775
  • 24
  • 45