WEB TECHNOLOGIES - ITC 351 Lecture - 5
WEB TECHNOLOGIES - ITC 351 Lecture - 5
ITC 351
Web Technologies.
Lecture Five
Outline of Instruction
3. Introduction to Scripting.
1
10/23/2018
Lecture Objectives
• By the end of the lecture, the student will be able
to:
– Present data in tables on web pages.
– Design forms for user inputs.
– Explain and differentiate between server-side and
client-side scripting.
– Design user interfaces that accept inputs from users
and display the result to users using scripts.
2
10/23/2018
3
10/23/2018
4
10/23/2018
Spanning Columns
• The colspan attribute lets you create cells that span
multiple columns of a table.
• Column cells always span to the right.
• The syntax is given as:
<tr>
<td colspan=“number of columns”> Content goes here.</td>
</tr>
• Example:
<tr>
<td colspan=“3”>
This text spans across 3 columns.
</td>
</tr>
Spanning Rows
• The rowspan attribute lets you create cells that span
multiple rows of a table.
• Rows always span down.
• The syntax is given as:
<tr>
<td rowspan=“number of rows”> Content goes here.</td>
</tr>
• Example:
<tr>
<td rowspan=“4”> This text spans across 4 rows down.</td>
<th>Name</th>
<th>Phone</th>
<th>Email</th>
</tr>
5
10/23/2018
6
10/23/2018
tr:hover td {
color: white;
background-color: #722750;
} Web Technologies Slides by: Maxwell Dorgbefu Jnr.
7
10/23/2018
8
10/23/2018
9
10/23/2018
10
10/23/2018
11
10/23/2018
12
10/23/2018
Introduction to Scripting
• Scripting is the act of writing little computer
programs that can enhance the appearance and
functionality of web page.
• Scripts are executed either at the server-side or
at the client-side.
• This leads to two categories of scripting:
–Server-side scripting and
–Client-side scripting.
13
10/23/2018
Server-Side Scripting - 1
• Server-side scripting is a web server technology in
which a user's request is fulfilled by running a script
directly on the web server to generate dynamic web
pages.
• This is different from client-side scripting where
scripts are run by the viewing web browser, usually in
JavaScript.
• It is usually used to provide interactive web sites that
interface to databases or other data stores.
• The primary advantage to server-side scripting is the
ability to highly customize the response based on the
user's requirements, access rights, or queries into data
stores. Web Technologies Lecture Slides by: Maxwell Dorgbefu Jnr.
Server-Side Scripting - 2
• Some commonly used server-side scripting
languages are:
– PHP (*.php)
– ASP/ASP.NET (*.asp/*.aspx)
– Perl (*.pl)
– ColdFusion Markup Language (*.cfm)
– Java via JSP(*.jsp)
– Python (*.py)
– Ruby (*.rb)
14
10/23/2018
Client-Side Scripting
• Client-side scripting is a type of scripting that
does all of its processing on the user's own
computer.
• It is commonly used to create pop-up windows,
instant-redirect pulldown menus, shopping-cart
calculations, and mouseover effects (i.e., menus
or images that change when the user's mouse
passes over them).
• Javascript is the most popular client-side
scripting language
Web Technologies Lecture Slides by: Maxwell Dorgbefu Jnr.
Programming Construct
• The three basic programming constructs are:
– Sequence :This construct enables us to
execute a set of statements one after the other
as they appear in a program.
– Selection: This enables us to create codes that
can respond to a variety of conditions.
– Iteration: This construct is used to repeat a
sequence of instructions in a program.
Another name for an iteration is a loop.
15
10/23/2018
16
10/23/2018
17
10/23/2018
18
10/23/2018
Summary - 1
• HTML tables make it possible for web developers
present information on web pages in an
organized manner.
• The <table> </table> tags describe the entire
table structure.
• The <tr> </tr> tags define a row in the table.
• The actual information to be presented in the
table is surrounded by the <td> </td> tags which
are further placed in the <tr> </tr> tags.
Summary - 2
• Web developers use HTML forms to accept inputs
from end users of web sites and web applications.
• The <form> </form> tag pair is used to
surround the form controls; which are the real
elements that allow end users to provide their
inputs.
• The action and method attributes of the <form>
tag are very important to add interactivity to web
sites and web applications.
19
10/23/2018
Summary - 3
• Scripting is lightweight programming.
• Scripting brings programmability to markup
languages.
• Server-side scripts run on the server and send
their result in a form of HTML codes to the
browser for onward display to end users.
• Client-side scripts are interpreted by the
scripting parsers of the browser architecture.
20