Monday, October 2, 2017

URL 7.1 Definition

URL
7.1 Definition
URL’s, or ‘uniform resource locators’, are the web browser addresses of internet pages
and files. It is the way to locate a file or document on the Internet. The URL specifies
the address of a file and every file on the Internet has a unique address. It works with IP
addresses to give a name, location to web pages. Web software, such as your browser, use
the URL to retrieve a file from the computer on which it resides.
Format of a URL:
Protocol://site address/path/filename
Every URL has three parts to address a page or file:
1. Protocol which ends with a ‘//:’
2. Host computer which ends with web extensions such as .com,.org etc.
3. Filename or page name which displays the related information.
Example:
http://www.banks.com/login/password.htm
The above URL consist of:
❖ Protocol : http
❖ Host computer name : www
❖ Domain name : banks
❖ Domain type : com
❖ Path : /login
❖ File name : password.html
7.2 Elements of Absolute and relative URL:
An Absolute URL is independent or free from any relationship. It specifies the exact
location of a file or directory on the internet. When you use an absolute URL, you target
a particular file. Thus, each absolute URL is unique, which means that if two URLs are
identical, they point to the same file. These URLs are always preferred as they help in
web site maintenance. Moreover, it is easy to transfer a web site from one domain name
to another, you need not to update each link on each page.
For example:
http://www.developers.com/images/hardware.gif
18 Information and Computer Technology
In above URL specifies an image file hardware.gif located in the images directory, under
domain name www.developers.com.
If we want to include the image file hardware.gif stored in the images directory of www.
developers.com domain on this page.
Using an Absolute URL in an <img> tag is as follows:
<img src= http://www.developers.com/images/hardware.gif width=”...” height=”...” />
A Relative URL is targeted to a file or directory in relation to the present file or directory.
If the web site has several sections and the files and web pages for each section have been
segregated into different directories. This helps in keeping things organized and uncluttered
on the web site. The relative URLs are shorter than absolute URLs and hence the file size
of the web page would reduce, if you use the former.
For example:
If we want to include the image file hardware.gif stored in the images directory of
www.developers.com domain on this page using an absolute URL.
The <img> tag for this image display will be as follows:
Using a Relative URL in an <IMG> tag
<img src=”../images/hardware.gif ” width=”...” height=”...” />

No comments:

Post a Comment