Free Online Courses for Software Developers - MrBool
× Please, log in to give us a feedback. Click here to login
×

You must be logged to download. Click here to login

×

MrBool is totally free and you can help us to help the Developers Community around the world

Yes, I'd like to help the MrBool and the Developers Community before download

No, I'd like to download without make the donation

×

MrBool is totally free and you can help us to help the Developers Community around the world

Yes, I'd like to help the MrBool and the Developers Community before download

No, I'd like to download without make the donation

Exploring the HTML URL: Uniform Resource Locator

This article will cover the HTML URL. I will demonstrate the functionality by giving some examples of relative and absolute URL.

Introduction:

In this tutorial you will learn about URL in HTML. I will also cover various prospects of using URL in HTML.

URL is abbreviation of uniform resource locator. This is a unique string of letters, numbers, words and other characters used to access specific web material. URL can redirect you to a specified content, documents, pictures, video clip, program, etc. URL is also referred to as a hyperlink.

All URL basically contains the three sections

  • The name of the resource itself, which is given as a path.
  • The name of the machine hosting the resource.
  • The name of the protocol used to transfer the resource over the Web.

The below example will clear the concept of URL. Suppose that we have link
(http)://(www).(abcdef.com):(xyz)/(pqrs)/(document_name).
Each part holds a specific area in URL. Following description will explain about each component in URL.
(http)- This is commonly name as scheme, defines the type of Internet service
(www)- this part defines the domain host for http
(abcdef)- This part holds the Internet domain name, such as facebook.com or twitter.com.
(: xyz)- This part will holds the port number at the host such as http will take 80 port no by default.
(pqrs): This part describes the path name of any file or documents stored on server side.
(document_name): document_name will defines the name of a document/resource

This is important to know that URLs are case-sensitive. There may be some URLs, or parts of URLs, where case doesn't matter, but identifying URL is not easy. Users should always consider that URLs are case-sensitive.

All web pages have a web address (https://www.abcd.com/pages/number/file_name.html ) or URL usually contains the name of ISP (internet service provider) this is very important to know if your are inserting a hyperlink on one page, which links to a second page in the same directory, the URL used for the second page is simply the name of that document extra-for example, file_name.html

There are basically two types of URL:

Relative URL:

Relative URL shows from where the current page is relating to resource. For example /html/html_video_links.htm

A relative URL doesn't contain any protocol or machine information, and its path generally refers to an HTML document on the same machine as the current document. Relative URLs may contain relative path components.

Absolute URL:

An absolute URL is the complete address of a resource, everything your system needs to find a document and its server on the Web.

There is one more concept related to relative URL, Resolving URL. Basically resolving a URL is the process of taking a relative URL and obtaining the absolute URL.

URL in HTML:

URLs play vital role in HTML you can see URLs in various parts of HTML programming. These are the areas where URLs appears in HTML:

  • Linking to another document or program, we use generally base, a, link, area, form, input, script etc.
  • When including an object directly in a document, you can see IMG, Frame element.
  • When referring to metadata describing document. You can see as a example head section of HTML program. A simple script will clear the all concepts related to URLs in HTML.

Listing 1: HTML URL Script

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="3; url=http://www.facebook.com" />
<title>HTML URL Example</title>
</head>
<body>
<a href="http://www.facebook.com" target="_blank">Example 1: Click Here To go Homepage of Facebook</a>

<p> 
<script type="text/javascript">
document.write("This is example of script: we have added this hello toast Here we can refer any URL to process any document")
</script> 
</p>

<h2>Example2: This is example of adding external document on page via image url or image source path</h2>
<img class='imagem_artigo' border="0" src="facebook.png" alt="facebook pic" width="304" height="228" />
</body>
</html> 
Above figure is output of a simple program of HTML in which various section are discussing URLs in HTML

Figure 1: Above figure is output of a simple program of HTML in which various section are discussing URLs in HTML.

The above example have a meta tag with a url, and this meta tag have a property to refresh the page in every 3 seconds. When the page will refresh first time, it will redirect the page to url given in meta tag.

Example also gives an idea to add image by giving the relative URL, not a full path. The code is just having src="facebook.png", it means image is in the same directory in which html page is residing.

You can also see the example of absolute path in: href=http://www.facebook.com. Here href contains the full path of facebook first page.

Conclusion:

I have covered the basic understanding of URL and locating the specific resource. I would recommend you that understand the example given with this tutorial and let us know your questions by commenting at mrbool site.



I am Software Developer from India. I hold B.Tech. in Computer Science & Engineering. I am having 2+ years experience of developing Web applications and Websites using HTML, JavaScript, CSS, C#.NET etc..

What did you think of this post?
Services
[Close]
To have full access to this post (or download the associated files) you must have MrBool Credits.

  See the prices for this post in Mr.Bool Credits System below:

Individually – in this case the price for this post is US$ 0,00 (Buy it now)
in this case you will buy only this video by paying the full price with no discount.

Package of 10 credits - in this case the price for this post is US$ 0,00
This subscription is ideal if you want to download few videos. In this plan you will receive a discount of 50% in each video. Subscribe for this package!

Package of 50 credits – in this case the price for this post is US$ 0,00
This subscription is ideal if you want to download several videos. In this plan you will receive a discount of 83% in each video. Subscribe for this package!


> More info about MrBool Credits
[Close]
You must be logged to download.

Click here to login