Numbers, strings and dates in JavaScript

Slides:



Advertisements
Similar presentations
A really fairly simple guide to: mobile browser-based application development (part 4, JQuery & DOM) Chris Greenhalgh G54UBI / Chris Greenhalgh.
Advertisements

Abelian Kingdom Andrew, Kelvin and Peter. What is it? A web (browser) game MORPG on Google map Login with Facebook Interact with your friends And the.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Responsive Web Design (RWD) MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/11/2016.
Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016.
1 Project 8: Tic Tac Toe. 2 Assignment Write an HTML and JavaScript page that pemits users to play Tic Tac Toe. Both players use a single browser. Alternating.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
JQuery Fundamentals Introduction Tutorial Videos
Build in Objects In JavaScript, almost "everything" is an object.
Form Data (part 2) MIS 3502, Fall 2015 Jeremy Shafer Department of MIS
12/04/12 JQuery I took these slides from the site because they were pretty good looking. Instructions for editing school and department titles: Select.
Responsive Web Design (RWD)
Class01 Course Introduction
jQuery – Form Validation
JQUERY Online TRAINING AT GOLOGICA
JavaScript Functions.
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
Introduction to JavaScript
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS
© 2015, Mike Murach & Associates, Inc.
A second look at JavaScript
Getting started with jQuery
A (gentle???) Introduction to JavaScript
JavaScript for Gadget Development
Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS
Class07 PHP: loops MIS 3501 Jeremy Shafer Department of MIS
MySQL Backup, Transfer and Restore
HTML5 APIs MIS3502 Jeremy Shafer Department of MIS
HTML and CSS MIS 2402 Jeremy Shafer Department of MIS
Sending a text message (and more)
Input CS 422: UI Design and Programming
Form Validation (with jQuery, HTML5, and CSS)
Form Validation, Part 2 (with jQuery, HTML5, and CSS)
JavaScript and the DOM MIS 2402 Jeremy Shafer Department of MIS
MIS JavaScript and API Workshop (Part 3)
Introduction to AJAX and JSON
An Introduction to Animation
MIS JavaScript and API Workshop (Part 2)
Expressions Unit 3 is all about expressions. Here, we talk about different ways to express something else. For example, I might ask you to call a dog.
An Introduction to JavaScript
Programming Control Structures with JavaScript Part 2
Getting started with jQuery
Javascript and JQuery SRM DSC.
An introduction to jQuery
Loops and Arrays in JavaScript
JavaScript objects, functions, and events
Introduction to JavaScript
ხელმძღვანელი: დიმიტრი ქარაული
An introduction to jQuery
Introduction to MIS3502 MIS 3502 Jeremy Shafer Department of MIS
MVC – Model View Controller
PDO and Arrays MIS 3502 Jeremy Shafer Department of MIS
Leveraging existing code in Metro style apps
Getting started with jQuery
Programming Control Structures with JavaScript
An introduction to jQuery
Introduction to AJAX and JSON
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Front End Development workshop
Form Validation (with jQuery, HTML5, and CSS)
Sending a text message (and more)
Strings and Dates in JavaScript
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Single Page Architecture (SPA)
Murach's JavaScript and jQuery (3rd Ed.)
Murach's JavaScript and jQuery (3rd Ed.)
Murach's JavaScript and jQuery (3rd Ed.)
MORE WAYS TO PLAY.
JavaScript and the DOM MIS 2402 Maxwell Furman Department of MIS
Presentation transcript:

Numbers, strings and dates in JavaScript MIS 2402 Jeremy Shafer Department of MIS Fox School of Business Temple University

We’ve come a long way …

Things we’ve learned about HTML and CSS JavaScript jQuery jQuery as a tool for manipulating the DOM jQuery as a tool for animating the DOM Form validation using jQuery Form validation using HTML5 controls and CSS3 Ajax and JSON We even learned a little bit about Regular Expressions!

What for? Every new concept we learn is a new tool in our mental toolbox. This mental toolbox helps us: Understand how applications work Envision what’s possible For example: You might not be a great web designer, but you should know enough HTML and CSS to work with a good design template. You might not know how to validate a time in military time… but you should know that there’s a regular expression for that! You might not know how to write a chatbot, but there’s probably an API for that that uses Ajax and JSON!

These next two classes … We’re going to take a step back and let some of those big ideas simmer for a while. In these next two classes we will be looking at some functionality in JavaScript itself. This functionality is available to us without jQuery or any external resource! jQuery is great at simplifying code. But it doesn’t simplify everything. Think of these next two classes as “extra ingredients” to think about while we let the other material sink in.

Objectives (this class and next)

Objectives (continued)

Objects, objects, objects! Recall that JavaScript and jQuery rely heavily on the notion of objects. Some objects we have seen: Window Document jQuery … which can also be written as $ We also observed that JavaScript arrays and strings are objects. Here are two new objects for today: Number Math

Properties of the Number object

Examples of properties of the Number object

Methods of the Number object Let’s see some examples: number.html

The Math object One property of the Math object Common methods of the Math object

More about the Math object Where did JavaScript come from? https://en.wikipedia.org/wiki/ECMAScript The exponentiation operator of ECMAScript 2016 and beyond The random() method of the Math object Let’s see some examples: math.html

Let’s play a game… Use the chrome developer tools to step through the application.

Something to think about What if you wanted to change the rules? What if each player had to roll two dice at a time? How could you simulate that? With two dice, rolling a one would be impossible. But you could make the game harder / more interesting by making a value of 7 the trigger to lose points. How could you make that change?