Chapter 5 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1.

Slides:



Advertisements
Similar presentations
Murach’s C# 2010, C6 © 2010, Mike Murach & Associates, Inc.Slide 1.
Advertisements

Murach’s C# 2010, C3 © 2010, Mike Murach & Associates, Inc.Slide 1.
Murach’s JavaScript, C3© 2009, Mike Murach & Associates, Inc.Slide 1.
Murach's C# 2012, C3© 2013, Mike Murach & Associates, Inc.Slide 1.
Murach’s JavaScript, C2© 2009, Mike Murach & Associates, Inc. Slide 1.
Murach's MySQL, C2© 2012, Mike Murach & Associates, Inc.Slide 1.
Murach’s JavaScript, C1© 2009, Mike Murach & Associates, Inc. Slide 1.
Murach’s C# 2010, C1© 2010, Mike Murach & Associates, Inc.Slide 1.
© 2013, Mike Murach & Associates, Inc.
Murach’s C# 2010, C4 © 2010, Mike Murach & Associates, Inc.Slide 1.
Murach’s C# 2010, C4 © 2010, Mike Murach & Associates, Inc.Slide 1.
Murach's C , C4 © 2009, Mike Murach & Associates, Inc. Slide 1 © 2009, Mike Murach & Associates, Inc.Slide 1.
Murach’s JavaScript, C5© 2009, Mike Murach & Associates, Inc.Slide 1.
Murach’s JavaScript, C2© 2009, Mike Murach & Associates, Inc.Slide 1.
Murach’s JavaScript, C13© 2009, Mike Murach & Associates, Inc.Slide 1.
Murach’s JavaScript, C1© 2009, Mike Murach & Associates, Inc.Slide 1.
Murach's C# 2012, C7© 2013, Mike Murach & Associates, Inc.Slide 1.
How to Work with Numeric and String Data
© 2012, Mike Murach & Associates, Inc.
Murach’s Visual Basic 2008, modified, C8© 2008, Mike Murach & Associates, Inc. Slide 1.
Chapter 2 Murach's JavaScript and jQuery, C2© 2012, Mike Murach & Associates, Inc.Slide 1.
Chapter 1 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1.
Chapter 4 Murach's JavaScript and jQuery, C4© 2012, Mike Murach & Associates, Inc.Slide 1.
Chapter 6 Murach's JavaScript and jQuery, C6© 2012, Mike Murach & Associates, Inc.Slide 1.
Murach's ASP.NET 4.5/C#, C3© 2013, Mike Murach & Associates, Inc.Slide 1.
Murach's ASP.NET 4.5/VB, C5© 2013, Mike Murach & Associates, Inc.Slide 1.
© 2016, Mike Murach & Associates, Inc.
© 2016, Mike Murach & Associates, Inc.
© 2009, Mike Murach & Associates, Inc.
© 2015, Mike Murach & Associates, Inc.
© 2016, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2016, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2011, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
The relational operators
© 2015, Mike Murach & Associates, Inc.
© 2011, Mike Murach & Associates, Inc.
© Akhilesh Bajaj, All rights reserved.
© 2010, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2015, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
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.)
© 2010, Mike Murach & Associates, Inc.
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.)
Murach's JavaScript and jQuery (3rd Ed.)
Murach's JavaScript and jQuery (3rd Ed.)
© 2017, Mike Murach & Associates, Inc.
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:

Chapter 5 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1

Objectives Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 2

The syntax for creating an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 3

The syntax for creating an array and assigning values in one statement Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 4

The syntax for referring to an element of an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 5

One property and one operator for an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 6 length – the number of elements in the array delete – deletes the contents of an element and sets the element to undefined, but doesn’t remove the element from the array.

How to add an element to an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 7

How to delete an element at a specific index Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 8

Code that puts 1 through 10 into an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 9

The message that’s displayed Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 10

Code that gets the sum and average of an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 11

The message that’s displayed Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 12

The syntax of a for-in loop Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 13

The message that’s displayed Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 14

The difference between for and for-in loops Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 15

The messages that are created by the loops Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 16

Terms Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 17

Six of the methods of an Array object Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 18 Push(element_list) – Adds one or more elements to the end of the array, and returns the new length of the array. Pop() – removes the last element in the array, decrements the length, and the element that it removed Unshift(elements_list) – adds one or more elements to the beginning of the array and returns the new length of the array Shift() – Removes the first element in the array, decrements the array length, and returns the element that it removed Join(seperator) – when no parameter is passed, this method converts all the elements of the array to strings and concatenates them seperated by commas. To change the seperator, you can pass this method a string literal toString() – Same as the join method without any parameter passed to it.

How to use the push and pop methods Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 19

How to use the unshift and shift methods Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 20

How to use the join and toString methods Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 21

The List app with state code validation Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 22

The HTML file for the page Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 23

The JavaScript for the application Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 24

The JavaScript for the application (continued) Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 25

Extra 5-1: Use a Test Score array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 26

Extra 5-2: Develop a To Do List application Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 27

Extra 5-3: Use Sales arrays Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 28

Short 5-1: Use Test Score arrays Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 29