Section 2.1 Introduction to Scripting
Learning Objectives
After you have completed this section, you should be able to
- list the fundamental programming elements of JavaScript.
- write scripts using these fundamental programming constructs.
Activities
Study Questions
- How do you embed JavaScript in an XHTML document?
- Where should JavaScript be embedded?
- What does the document object in JavaScript refer to?
- How do you write to a document object?
- What is the difference between the write and the writeln statement in JavaScript?
- In JavaScript, how do you get input from a user?
- What does the window object in JavaScript refer to?
- What are the differences between the alert and the prompt dialog from the window object?
- How do you define variables in JavaScript?
- How are the types of variables decided in JavaScript?
- How do you convert strings to integers in JavaScript?
- What data types can you use in JavaScript?
- What arithmetic operators can you use in JavaScript?
- How is equality represented in JavaScript?
- What relational operators are provided in JavaScript?
- What control structures are provided for selection and repetition in JavaScript?
- What assignment, increment, and decrement operators are provided in JavaScript?
- What keywords are reserved but not used by JavaScript?
Review
Do the self-review exercises at the end of Chapter 6.
Summary
Read the Chapter 6 summary.