Resources and URLs

On the Internet, and in programming languages and environments in general, every digital thing is considered to be a resource. HTML or text files are resources, pictures are resources, sound files are resources, Flash animation files are resources; any digital media file is a resource. Resource is a catch-all term for digital media or files of any kind.

As was mentioned earlier, HTML pages are really nothing but plain text files/resources which REFER to other types of media for their pictures, animations, etc; all the HTML file itself actually contains is text. A web browser, after reading an HTML file, gathers together the assorted resources (pictures, animations, sound files, scripts, etc) and assembles them into a unified whole for display in the browser window; this display is based on the layout specified in the HTML file.

The HTML page invokes (or calls up) its various resources using something called a URL. URL (pronounced Yoo-Arh-Ell) stands for Uniform Resource Locator. A URL is essentially a unique address on the Internet where something is located, either on your local server or anywhere in the world.

There are two kinds of URLs: absolute and relative. Absolute URLs point to a specific location on the entire Internet. Relative URLs point to a location on a web server which is in relation to the current HTML page. These differences can be better expressed using real-world metaphors.

An absolute URL is like an address with a zip code that you would use to mail a letter; the address points directly to a particular location, and that address doesn't change whether you're mailing the letter from San Francisco or Tokyo or Paris, i.e. "John Smith, 1205 Main Street, Anytown, CA, 93711-9308, USA".

A relative URL is like the directions you would give someone from your home or office to get to a particular location, i.e. "go to the corner and take a left, then go three blocks and take another left until you get to the store on the next corner, the package is sitting on the bottom shelf on the right just by the door". An absolute URL points directly to a particular resource on the Internet as a whole, whereas a relative URL gives directions to a resource in relation to your current location. We will discuss absolute and relative URLs in greater detail later in this module.

URLs are not only used to invoke pictures and animations on a web page, they are also the foundation of hyper-text or hot-links, the primary means of navigation on the Web; we'll discuss hyper-text/hyper-references in detail later in this module.

The Internet is a gigantic database, filled with many different resources. URLs are the means by which some small percentage of these resources can be drawn together, accessed, and utilized via a single web page.

Main Menu