Introduction to Client-Side
Scripting and JavaScript
CHAPTER 9
LOGO
, CONTENT
9.1 Introduction to Client-Side Scripting
9.2 Introduction to JavaScript
9.3 JavaScript Statements
9.4 JavaScript Comments
9.5 JavaScript Variables
9.6 JavaScript Operators
9.7 Conditional Statements in JavaScript
9.8 Loops in JavaScript
2
D. Gichuki
, 9.1 Introduction to Client-Side Scripting
❖ HTML is good for developing static pages
▪ can specify text/image layout, presentation,
links, …
▪ Web page looks the same each time it is
accessed
▪ in order to develop interactive/reactive
pages, must integrate programming in some
form or another
3
D. Gichuki
, 9.1 Introduction to Client-Side Scripting
Client-Side Scripting
▪ programs are written in a separate programming (or
scripting) language
e.g., JavaScript, JScript, VBScript
▪ programs are embedded in the HTML of a Web page,
with (HTML) tags to identify the program component
e.g., <script type="text/javascript"> … </script>
▪ the browser executes the program as it loads the
page, integrating the dynamic output of the program
with the static content of HTML
▪ could also allow the user (client) to input information
and process it, might be used to validate input before
it’s submitted to a remote server
4
D. Gichuki
Scripting and JavaScript
CHAPTER 9
LOGO
, CONTENT
9.1 Introduction to Client-Side Scripting
9.2 Introduction to JavaScript
9.3 JavaScript Statements
9.4 JavaScript Comments
9.5 JavaScript Variables
9.6 JavaScript Operators
9.7 Conditional Statements in JavaScript
9.8 Loops in JavaScript
2
D. Gichuki
, 9.1 Introduction to Client-Side Scripting
❖ HTML is good for developing static pages
▪ can specify text/image layout, presentation,
links, …
▪ Web page looks the same each time it is
accessed
▪ in order to develop interactive/reactive
pages, must integrate programming in some
form or another
3
D. Gichuki
, 9.1 Introduction to Client-Side Scripting
Client-Side Scripting
▪ programs are written in a separate programming (or
scripting) language
e.g., JavaScript, JScript, VBScript
▪ programs are embedded in the HTML of a Web page,
with (HTML) tags to identify the program component
e.g., <script type="text/javascript"> … </script>
▪ the browser executes the program as it loads the
page, integrating the dynamic output of the program
with the static content of HTML
▪ could also allow the user (client) to input information
and process it, might be used to validate input before
it’s submitted to a remote server
4
D. Gichuki