We are starting to program with JavaScript

Slides:



Advertisements
Similar presentations
Chapter 7 JavaScript: Introduction to Scripting. Outline Simple Programs Objects and Variables Obtaining User Input with prompt Dialogs – –Dynamic Welcome.
Advertisements

JavaScript Functions Please use speaker notes for additional information!
Lesson 4: Formatting Input Data for Arithmetic
Introduction to JavaScript Please see speaker notes for additional information!
JavaScript- Processing HTML Forms. Event Handlers Begins with and ends with.
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
Information Technology Center Hany Abdelwahab Computer Specialist.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
CIS101 Introduction to Computing Week 12 Spring 2004.
JavaScript Switch Statement. Switch JavaScript Switch Statement If you have a lot of conditions, you can use a switch statement instead of an if…elseif…
Introduction to scripting
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
Adding JavaScript (<script tag>)
Loops Doing the same thing over and over and over and over and over and over…
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
Documentation and Comments. What’s a comment? A comment is a simple form of documentation. Documentation is text that you the programmer write to explain.
Topic: An Introduction to JavaScript - from Beginning JavaScript by Wilton (WROX)
Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around.
JavaScript Adding active content to websites. Goals Understand structure of JavaScript Understand rules of coding Add active content to WebPages Add functions.
Variety of JavaScript Examples Please use speaker notes for additional information!
Dr. Qusai Abuein1 Internet & WWW How to program Chap.(6) JavaScript:Introduction to Scripting.
1 JavaScript
Input & Output Functions JavaScript is special from other languages because it can accept input and produce output on the basis of that input in the same.
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
1 A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 4 JavaScript and.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
JavaScript Challenges Answers for challenges
Functions (doing a calculation) Please use speaker notes for additional information!
Creating a mystic meg program A simple program asking the user questions and using their answers to build up a fortune telling in a list.
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Answer questions about assignment.. Starting JavaScript, at my site these examples are under programs and JavaScript. You can see the address for this.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
JavaScript 101 Lesson 6: Introduction to Functions.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
JavaScript JavaScript is a programming language that web browsers understand. You can use it to make your web pages interactive by: Responding to user.
Subroutines (PrArith, Math,projCP1, PrAdrProc, PrAdrProcFunc) Please use speaker notes for additional information!
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
© 2010 Robert K. Moniot1 Chapter 6 Introduction to JavaScript.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
CHAPTER 10 JAVA SCRIPT.
Chapter 6 JavaScript: Introduction to Scripting
Project 9 Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms.
Variables, Expressions, and IO
HTML.
Introduction to DOM.
Use proper case (ie Caps for the beginnings of words)
Please use speaker notes for additional information!
Number and String Operations
WEB PROGRAMMING JavaScript.
Lesson 1: Decomposition
Javascript Game Assessment
Lesson 2: Input and Variables
T. Jumana Abu Shmais – AOU - Riyadh
We are starting JavaScript. Here are a set of examples
Note the rights settings.
The + can mean concatenate or add
JavaScript.
7 – Variables, Input and Output
Introducing JavaScript
JavaScript: Introduction to Scripting
Module 5 ● Vocabulary 1 a sensing block which will ask whatever question is typed into the block and display an input text box at the bottom.
This is an introduction to JavaScript using the examples found at the CIS17 website. In previous examples I specified language = Javascript, instead of.
Basic program gives only one quess and then the program ends.
Did a few weeks ago. tag would work..
Presentation transcript:

We are starting to program with JavaScript We are starting to program with JavaScript. Here are a series of examples. Once you have opened them, you can see the HTML code by viewing the course.

This is the first example This is the first example. It writes on the document or screen and it brings up an alert.

The alert, pops up a screen with what is inside the parenthesis The alert, pops up a screen with what is inside the parenthesis. Again it is a literal and that is what appeared in the alert box.

This is the second example, it has a prompt that asks the user for input.

I define the memory variables I am using in the program. message appears above the box where the user enters information. Then I write on the document the contents of the parenthesis which is ans. I write the contents of the memory variable ans.

First I write the literal "The answer is" and then I write what is stored in the memory variable ans.

in concatenated. When I made sure I had numbers, it added. Note that JavaScript is case sensitive so it has to be written as parseFloat with a capital F and parseInt with a capital I.

This is parseInt. When I want to skip down to the next line, I can document write the html <br>. I put it inside quotes and it then uses the <br> and writes the line.

A single = means assign. In the calculation I multiply or divide firstnum and secondnum and assign the answer to ans.

Note this means that an end if is not needed because I tell it everything I want to do if I execute the if and everything I want to do if I execute the else.

it is a /.

the second if and wrote out the 0 for ans.