internet applications development lecture 5 l. obead alhadreti

16
Internet Applications Development Lecture 5 L. Obead Alhadreti

Upload: beverley-mckenzie

Post on 29-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Internet Applications Development Lecture 5 L. Obead Alhadreti

Internet Applications Development

Lecture 5

L. Obead Alhadreti

Page 2: Internet Applications Development Lecture 5 L. Obead Alhadreti

Lecture Outline:

• Links with HTML.

Page 3: Internet Applications Development Lecture 5 L. Obead Alhadreti

• How do we move from a web page to another ?!

• We can move between web pages by clicking on a hyperlink.

• A hyperlink (or link) is a word, group of words, or image that you can click on to jump to a new destination.

• Hyperlinks are the spirit of the Web. If the web is a spider as a whole, these links are the threads that make up this network and link between millions of addresses.

• The question now is: How to insert a hyperlink?

Page 4: Internet Applications Development Lecture 5 L. Obead Alhadreti

• Links inserted using the a (anchor) tag:

<a> </a>

• href (Hypertext Reference) attribute:

href specifies the address you would like to link to.

< a href=“address”> text/image </a>

Page 5: Internet Applications Development Lecture 5 L. Obead Alhadreti

• Example:

<a href=“index.html”> home page </a>

• Display:

home page

Page 6: Internet Applications Development Lecture 5 L. Obead Alhadreti

• Example:

<a href=“index.html”> <img src=“1.jpg”> </a>

• Display:

Page 7: Internet Applications Development Lecture 5 L. Obead Alhadreti

• There are several options for hyperlinks:

it can be a link to another site, another page within the site itself, a place in the same page (up or down), or an email address.

Page 8: Internet Applications Development Lecture 5 L. Obead Alhadreti

• 1st Type : Insert a hyperlink to an external web site.

Example:

<a href=“http://www.uqu.edu.sa”> Uqu </a>

Display:

Uqu

Page 9: Internet Applications Development Lecture 5 L. Obead Alhadreti

Example:

<a href=“http://www.uqu.edu.sa”>

<img src=“uqu.jpg”> </a>

Display:

Page 10: Internet Applications Development Lecture 5 L. Obead Alhadreti

• 2nd Type : link refers to an existing file in the same website (i.e. a local file), whether html file, image, or otherwise:

Example:

<a href=“timestable.html"> times table </a>

Display:

times table

Page 11: Internet Applications Development Lecture 5 L. Obead Alhadreti

Example:

>a href="http://www.uqu.edu.sa/images/1.jpg<"

first image </a<

Display:

first image

Page 12: Internet Applications Development Lecture 5 L. Obead Alhadreti

• 3rd Type : the link refers to a place within the same page,( for example at the beginning or at the end of the page or any other place you want)

• To link to a place within your existing page, firstly, a name must be given to the anchor using the name attribute.

example:

<a name=“abc”> top </a>

Page 13: Internet Applications Development Lecture 5 L. Obead Alhadreti

• Secondly, we create the links by placing the hash symbol followed by the name of the anchor in the href of the new link.

example:

<a name=“abc”> top </a>

<a href=“#abc”> top </a>

Page 14: Internet Applications Development Lecture 5 L. Obead Alhadreti

• Fth Type : the link refers to email address, using

<a href=“mailto: …….@....... ”> </a>

example:

<a href=“mailto: [email protected]”> ahmed </a>

Display:

ahmed

Page 15: Internet Applications Development Lecture 5 L. Obead Alhadreti
Page 16: Internet Applications Development Lecture 5 L. Obead Alhadreti

Questions ?

Be active !