Presentation is loading. Please wait.

Presentation is loading. Please wait.

JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.

Similar presentations


Presentation on theme: "JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript."— Presentation transcript:

1 JavaScript 101 Introduction to Programming

2 Topics What is programming? The common elements found in most programming languages Introduction to JavaScript What software you will use to create and run JavaScript code

3 What is programming? A program is a set or sequence of instructions entered into a computer to perform work Programs are written using programming languages

4 What is a programming language? Programming languages consists of ways to represent information (data), and commands used to examine and/or change (update) information Modern languages resemble human languages, combined with arithmetic and keyboard symbols

5 How does a computer execute a program? Computers can only follow instructions written in their own language, machine code or binary code Binary code consists of nothing but 0s and 1s Programmer writes program, then that program needs to be translated into 0s and 1s

6 How does a program become binary code? Two possible techniques: Compiler: software that examines all the instructions, then translates full program into binary code Interpreter: software that examines one instruction at a time, translating it to binary code

7 JavaScript Next few weeks we will learn about programming with JavaScript JavaScript uses an interpreter to translate program into binary code Browser is the interpreter for JavaScript

8 Common Elements in Programming Languages Most programming languages consist of the following: Variables – data or information used in a program Data types – categories of types of information a program is capable of recognizing and processing Expressions – computer science term for a formula that generates a value

9 Common Elements cont. Keywords – words that have a special meaning in a language, and cannot be used for any other purpose. Also know as reserved words. Statements – commands that direct to computer to take some action Functions – sections of code, or mini- programs, that execute a well defined task. Also known as sub-programs, methods, or sub-routines.

10 About JavaScript Goal was to create a simple language that added interactivity to Web pages Allows code downloaded with HTML to be executed on local machine

11 Client Server Computer in front of you is example of a client Machine hosting Web pages called a server Before JavaScript, code always executed on the server This was very slow! Faster to download code and run it on the client

12 JavaScript can Display different HTML depending on if the browser is IE or Netscape Validate user input before transferring it to the server Create dynamic effects and animation

13 JavaScript Features Supported by IE and Netscape, although some differences exist Source code embedded in HTML document Programs respond to user actions, like mouse clicks Compact and relatively easy to learn

14 JavaScript is Object Based Other object based languages include Visual Basic and VB Script Object based languages have built in objects ready to use Objects are “packages” of data and commands combined in a single name JavaScript objects include document, window, and others

15 What software? Continue using Windows Notepad Browser (IE 6.0)


Download ppt "JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript."

Similar presentations


Ads by Google