Presentation is loading. Please wait.

Presentation is loading. Please wait.

“Under the hood”: Angry Birds Maze

Similar presentations


Presentation on theme: "“Under the hood”: Angry Birds Maze"— Presentation transcript:

1 “Under the hood”: Angry Birds Maze
LESSON 2: Java Script “Under the hood”: Angry Birds Maze

2 History First web scripting language Developed by Netscape and Sun
Initiated by Netscape and called LiveScript In parallel with this, Sun was developing Java

3 Why Use JavaScript? JavaScript enhances Web pages with dynamic and interactive features. JavaScript runs in client software JavaScript 1.3 works with version 4.0 browsers

4 What can JavaScript Do? JavaScript gives HTML desighners a programming tool JavaScript can react to events Validate data It can be used to detect the visitor’s browser Create cookies Read/write/modify HTML elements

5

6 JavaScript Terminology
JavaScript programming uses specialized terminology Understanding JavaScript terms is fundamental to understanding the script Objects, Properties, Methods, Events, Functions, Values, Variables, Expressions, Operators

7 Objects Object refers to windows, documents, images, tables, forms, buttons, or links, etc. Objects should be named. Objects have properties that act as modifiers

8 Properties Properties are object attributes.
Object properties are defined by using the object’s name, a period, and the property name. e.g., background color is expressed by: document.bgcolor. document is the object bgcolor is the property

9 Methods Methods are actions applied to particular objects. Methods are what objects can do. e.g., document.write (“Hello World”) document is the object write is the method

10 Functions Functions are named statements that performs tasks.
e.g., function doWhatever () {statement here} The curly braces contain the statements of the function. JavaScript has built-in functions, and you can write your own.

11 Values Values are bits of information.
Values types and some examples include: Number: 1, 2, 3, etc. String: characters enclosed in quotes. Boolean: true or false. Object: image, form Function: validate, doWhatever

12 Variables Variables contain values and use the equal sign to specify their value. Variables are created by declaration using the var command with or without an initial value state. e.g., var month; e.g., var month = April;

13 JavaScript terms Binary Code: Compiler: Condition: Interpretation:
Machine Readable Code (After JavaScript code has been translated by interpretation, it becomes binary code Compiler: Highly specialized piece of software that takes a programming language that humans can understand and converts it into language computers can understand Condition: A conditional statement tells the browser IF this condition is met, perform this function; if not (ELSE) perform a different function Interpretation: Describes the line-by line conversion process that occurs automatically at run time or when the Web browser launches the JavaScript commands that are embedded in the Web document

14 Vocabulary (Cont) Keywords: Methods: Objects:
Word recognized by the programming language as part of its language (IF, ELSE, RETURN) Methods: Specialized functions within the object, and they call upon the services of the object, a method is invoked after you type the name of the object, followed by a period Objects: Invisible entities that have a defined set of capabilities Operators: Placed between two tokens in a conditional statement

15 Vocabulary (continued)
Parameter List A list of information that provides a programming method what it needs to perform a specific function correctly. Programming Language A language that has to be converted from a human-readable format into machine-reada ble format. This process is accomplished by using a compiler to complete the operation. Scripting Language Language that does not have to be run through a compiler for it to be understood. Web browsers will take the human-readable format and convert it into machine-readable format “on the fly”. <SCRIPT> and </SCRIPT> tags The beginning and end tags that are necessary in a Web document for a JavaScript statement to be executed. All JavaScript code must be placed within the beginning and ending tag.

16 Vocabulary (continued)
Status Line Located at the bottom of the window. Displays various messages and is a way in which a JavaScript Web page can communicate information to the user. Token Either a variable name or a literal constant, followed by a relational operatior. A JavaScript condition will always consist of two tokens. Web Browser Often referred to as a Web client because it allows users to interface with different operating systems and view information on the World Wide Web. It allows Web page developers to have JavaScript compiled and interpreted “on the fly.”

17 JavaScript “Under the Hood”

18 Assignment Write Name and Class Color on a blank piece of paper
List the Four Commands introduced through video clips in the “Angry Bird Maze” REPEAT (Puzzle 6) REPEAT UNTIL (Puzzle 10) IF (Puzzle 14) IF/ELSE (Puzzle 18 Write a brief description of each command and when/why/how it is used (review video clips if necessary)


Download ppt "“Under the hood”: Angry Birds Maze"

Similar presentations


Ads by Google