CSS Colors, JavaScript Variables, Conditionals and Basic Methods

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

Murach’s JavaScript, C3© 2009, Mike Murach & Associates, Inc.Slide 1.
Murach’s JavaScript, C2© 2009, Mike Murach & Associates, Inc. Slide 1.
Murach’s JavaScript, C1© 2009, Mike Murach & Associates, Inc. Slide 1.
Slide 1 MIS3023 Professor: Akhilesh Bajaj The University of Tulsa.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
The Web Warrior Guide to Web Design Technologies
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.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Information Technology Center Hany Abdelwahab Computer Specialist.
CIS101 Introduction to Computing Week 09 Spring 2004.
Introduction to scripting
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Murach’s JavaScript, C2© 2009, Mike Murach & Associates, Inc.Slide 1.
Java Programming Constructs 1 MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 14 JavaScript.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
 2000 Deitel & Associates, Inc. All rights reserved. Outline 8.1Introduction 8.2A Simple Program: Printing a Line of Text in a Web Page 8.3Another JavaScript.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
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 1 COE 201- Computer Proficiency. Introduction JavaScript scripting language ▫Originally created by Netscape ▫Facilitates disciplined approach.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Chapter 2 Murach's JavaScript and jQuery, C2© 2012, Mike Murach & Associates, Inc.Slide 1.
Murach, Chapter 5. Common Control Structures Selection: The IF statement Case: The Select Case statement Iteration: Loops 9/28/20082.
Chapter 4 Murach's JavaScript and jQuery, C4© 2012, Mike Murach & Associates, Inc.Slide 1.
Chapter 5 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1.
REEM ALMOTIRI Information Technology Department Majmaah University.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
INTERNET APPLICATIONS CPIT405 JavaScript Instructor: Rasha AlOmari
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
Chapter 6 JavaScript: Introduction to Scripting
© 2016, Mike Murach & Associates, Inc.
© 2009, Mike Murach & Associates, Inc.
JavaScript is a programming language designed for Web pages.
© 2015, Mike Murach & Associates, Inc.
JavaScript Fundamentals
Introduction to Scripting
© 2010, Mike Murach & Associates, Inc.
Objectives Insert a script element Write JavaScript comments
The relational operators
Exercises on JavaScript & Revision
© 2015, Mike Murach & Associates, Inc.
CSS Colors, JavaScript Variables, Conditionals and Basic Methods
© Akhilesh Bajaj, All rights reserved.
WEB PROGRAMMING JavaScript.
© 2015, Mike Murach & Associates, Inc.
T. Jumana Abu Shmais – AOU - Riyadh
The Internet 11/22/11 Conditionals and Loops
We are starting JavaScript. Here are a set of examples
An Introduction to JavaScript
JavaScript CS 4640 Programming Languages for Web Applications
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript: Introduction to Scripting
Murach's JavaScript and jQuery (3rd Ed.)
Murach's JavaScript and jQuery (3rd Ed.)
Murach's JavaScript and jQuery (3rd Ed.)
Murach's JavaScript and jQuery (3rd Ed.)
Murach's JavaScript and jQuery (3rd Ed.)
Presentation transcript:

CSS Colors, JavaScript Variables, Conditionals and Basic Methods © 2017, Akhilesh Bajaj. All rights reserved.

© 2017Akhilesh Bajaj, All rights reserved. Color Coding in CSS3 - Binary versus Decimal versus Hexadecimal Quantity: 2, 8, 9, 10, 11, 16, 17. - One hexadecimal digit is represented using 4 bits. RGB Scheme for colors: 2 hexadecimal digits or 8 bits each. How many total colors can we have? -Look up HTML5 color wheels. © 2017Akhilesh Bajaj, All rights reserved.

A script element that embeds JavaScript in the head section Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

JavaScript in the body of an HTML document Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

A nonscript element in the body of an HTML document A nonscript element in the head of an HTML document Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

How to split a statement over two or more lines Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

A JavaScript function with the identifiers highlighted Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

Camel casing versus underscore notation Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

A block of JavaScript code with the comments highlighted Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

© 2015, Mike Murach & Associates, Inc. How to code comments Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

Common methods of the window object Do loops using confirm() method on w3 schools code. Murach's JavaScript (2nd Ed.), C2

A statement that calls the prompt method with the object named omitted Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

Two methods of the window object for working with numbers Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

Examples that use the parseInt and parseFloat methods Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

The same examples with the parse methods embedded in the alert method Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

Other examples of parse methods Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

© 2015, Akhilesh Bajaj. All rights reserved. Fun In Class Assignment for if and for Write a javascript based program, called ComputeTotalSalary for our sales force. The program should have 1 html file, 1 css file and 1 js file. It should ask the user to input the name of the salesperson (String), the base salary and the total sales of last year (check they Are both numbers). If the sales are below zero, the program should print an error and exit. If the sales are between $1 and $25,000, the program should add a bonus of 5% of the sales to the base. If the sales are between $25,000 and $50,000, the program should add a bonus of 10% of sales. If the sales are between $50,000 and $100,000 it should add a bonus of 15% of sales. Sales over $100,000 merit a 20% of-sales bonus. Finally, the program should print the statement: The final salary of ----- is $XXXX.XX and ask the user if they want to run again. If the user says Yes or Y, it should run again, otherwise, it should say thanks and exit. © 2015, Akhilesh Bajaj. All rights reserved.

One property of the window object Fun Assignment: Write an HTML page with one button, labeled Search. When clicked, it opens a new window with your favorite search engine. Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

Two methods of the document object Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

write() and writeIn() statements in the body Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

Examples of number values Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

Common arithmetic operators Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

The order of precedence for arithmetic expressions Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

The most useful assignment operators Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

The concatenation operator for strings Escape sequences that can be used in strings Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

How to declare string variables and assign values to them Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

How to code compound assignment statements Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.

How escape sequences can be used in a string How to declare Boolean variables and assign values to them Murach's JavaScript (2nd Ed.), C2 © 2015, Mike Murach & Associates, Inc.