Review Java Script and the Web Developer Console

Review: Java. Script and the Web Developer Console Jeremy Shafer Department of MIS Fox School of Business Temple University

Course overview CLIENT Browser Java. Script (Java. Script and j. Query) HTML (HTML 5, Bootstrap, j. Query) SERVER HTTP (URL with URL encoded data) Node SQL Java. Script JSON response express sync-mysql Slide 2

What’s the plan? 1. Discuss: The nature of today’s class 2. Discuss: Problem Solving 3. Review: Java. Script essentials 4. Challenge: Your second assignment Slide 3

What is today’s class all about In today’s class we will review some of the basics of the Java. Script language. It’s a good opportunity to ask questions, and (hopefully) initiate some memories of previous course work. We won’t be worrying about the user interface today, or APIs. Instead we will focus on some of the fundamental pieces of the Java. Script language. We’ll run all of today’s code in a browser (Chrome) and we’ll re-acquaint ourselves with the Web Developer Tools there. So… our goal for today is not to make anything “pretty” and it is not to make anything that exists outside the browser! That is, there are no servers, and no APIs involved. However, we should be able to make something simple that works and helps us remember Java. Script syntax. But before we do that… Slide 4

Discussion How do you go about solving an unfamiliar problem? There is no *one* right answer. In fact, good problem solvers employ multiple techniques. Here are some of them: ü Form a theory / experiment. ü See if you can get *closer* to a solution. ü Draw a picture. ü Make a list, break the problem down into smaller pieces. ü Ask someone who knows or has done something similar. Slide 5

Today’s problem: Write some simple Java. Script code that runs in the browser. It should prompt the user in some way to either roll the dice or stop rolling the dice. The outcome of the dice roll should be reported somewhere. If both dice have a combined value of seven, report “LUCKY SEVEN!” After each roll, prompt the user again to see if the user wants to either roll again, or stop. What are the “must have” puzzle pieces? • The <script> tag • prompt() • var • console. log() • if • for What are some “nice to have” pieces? • functions Is there a puzzle piece we *don’t* have? • Math. random(); //see https: //bit. ly/2 LWju 4 M What should we do? Slide 6

Your second assignment See the assignment 02 document for details about the roll-three-dice assignment. Vector Design by Vecteezy! Slide 7
- Slides: 7