Due Next Monday Assignment 1 Start early

Slides:



Advertisements
Similar presentations
Microsoft® Word 2010 Training
Advertisements

Microsoft ® Office Outlook ® 2007 Training Retrieve, back up, or share messages Sweetwater ISD presents:
Introduction to JavaScript Module 1 Client Side JS Programming M-GO Sponsored By
Escaping Characters document.write(). Learning Objectives By the end of this lecture, you should be able to: – Recognize some of the characters that can.
Debugged!.  You know that old line about an ounce of prevention?  It’s true for debugging.
WaveMaker Visual AJAX Studio 4.0 Training Troubleshooting.
Adding Content To Your Faculty Page 1.Login 2.Create your Faculty Page 3.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
Ajax - 1h. AJAX IS: A browser technology A technology that uses only JavaScript in the browser page A very efficient way of updating information A way.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Creating a Web Site Using 000webhost.com The 000webhost.com Site You will be required to create an account in order to use their host computer 000webhost.com.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
BIT 286: Web Applications Automated Web Testing. Selenium  Selenium Is moving from being Firefox based to being more of a 'normal desktop' program that.
 When you receive a new you will be shown a highlighted in yellow box where your can be found  To open your new just double click.
BMTRY 789 Lecture 11: Debugging Readings – Chapter 10 (3 rd Ed) from “The Little SAS Book” Lab Problems – None Homework Due – None Final Project Presentations.
Loops.  (No Quiz)  Hand in Assignment #1  Last chance for Q+A on the midterm  Loops 2.
Radio Buttons.  Quiz  Radio Buttons  Check boxes 2.
Functions.  Assignment #2 is now due on Wednesday, Nov 25 th  (No Quiz)  Go over the midterm  Backtrack and re-cover the question about tracing the.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Getting Started with HTML. HTML  Hyper Text Markup Language  HTML isn’t a program language, its known as a markup language  A Markup language has tags.
screen shots Emma Jarman. Adding attachments What is an attachment? An attachment is an that has a file attached to it. The file could be.
Logical Operators.  Quiz  Let's look at the schedule  Logical Operators 2.
Check Boxes. 2 Check boxes  Image from:  HTML:  Each box gets it's own.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Working with ASP.NET Controls What is ASP.NET Using server controls in your pages Allowing users to create their own accounts Creating a login page Letting.
Instructional Design Center Embedding Google Documents in Blackboard.
Levitra 20 mg Getting started with Firefox New to Firefox? Well you’ve come to the right place. This article covers all the basics and will get you up.
BIT 286: Web Applications Automated Web Testing. Selenium  Selenium Is moving from being Firefox based to being more of a 'normal desktop' program that.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
BIT116: Scripting Lecture 05
FOP: Multi-Screen Apps
Development Environment
More about comments Review Single Line Comments The # sign is for comments. A comment is a line of text that Python won’t try to run as code. Its just.
Lecture 2 D&D Chapter 2 & Intro to Eclipse IDE Date.
A few notes on writing a rough draft
BIT116: Scripting Lecture 06
BIT116: Scripting Loops.
While multiplying larger numbers involves more steps, it’s not necessarily more challenging. If you know the steps to organize the process. So, what strategies.
Melanie Edmondson County Operations
Logging In ASP.Net Core 1.1.
Chrome Developer Tools
Form Validation and AJAX
Microsoft® Word 2010 Training
Microsoft® Word 2010 Training
Saving, Modifying page, grammar & spell checking, and printing
Barb Ericson Georgia Institute of Technology Dec 2009
Intro to PHP & Variables
Cookies BIS1523 – Lecture 23.
Predefined Dialog Boxes
Logging In ASP.Net Core 2.0.
UNITY TEAM PROJECT TOPICS: [1]. Unity Collaborate
Building Web Applications
Lesson 12.
Unit 11 – PowerPoint Interaction
Add some WordArt to your cover slide
Introduction to TouchDevelop
MIS2502: Data Analytics MySQL and SQL Workbench
Blackboard Tutorial (Student)
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
At GMAIL IGOOGLE Most of you have signed up for , but the first half of these slides are here if you want to help others . .
Ok, now you have sent an to
BIT116: Scripting Radio Buttons.
How to debug a website using IE F12 tools
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Murach's JavaScript and jQuery (3rd Ed.)
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Intro to Programming (in JavaScript)
Selenium IDE Installation and Use.
Presentation transcript:

Due Next Monday Assignment 1 Start early There are several pieces that you need to figure out on your own You are allowed to work in pairs The same work from 3+ people will be treated as plagiarism / academic misconduct

BIT116: Scripting Lecture 06 Debugging and Troubleshooting

Today Quiz JavaScript: Debugging and trouble-shooting

Debugging JavaScript From Bing.com

Chrome's Developer Tools How to open this? F12, or Control+Shift+I Quick, Easy Cryptic Right-click, select "Inspect Element" Easier to remember Puts you into the 'inspect HTML element' panel, which isn't what we want for JS Menu button  More tools  Developer tools Cross-platform (same for Windows, Mac, Linux) Easy to remember It reminds you about Control+Shift+I

WARNING: Opening Developer Tools stops Live Preview There's a bug in Brackets somewhere Opening the Developer Tools will stop the Live Preview in that browser window You can just close the browser, and click the Live Preview lightning bolt again

Alerts & Logging

How do you know what your program is actually doing? Let's get the program to tell us We can use (at least) two strategies: alert boxes & logging Call the alert function This will stop the program, pop up a dialog box that displays our message, and wait for us to click 'ok'. It can get annoying very quickly Call a logging function to print our message to the console

Alert boxes Let's look at alert_01.html Type something in & click the button Notice how the alert boxes keep popping up, telling you where the program has reached, and what you typed in Try leaving the input box blank & clicking the button Notice that we've chosen a message that makes it clear that the string is empty

Logging Let's look at logging_01.html The only difference between this & alert_01.html is that we've replaced alert() with console.log() Type something in & click the button Notice that you don't see any dialog boxes Or anything else  Bring up the Developer Tools panel Then click on the Console tab (red rectangle) And you'll see your messages! (blue rectangle) And which file & line logged them! (green rectangle) (Click on these to show the line) Try it again, with an empty input box

Alerts vs. Logging Alerts are quick, easy, work on all browsers since forever, and are great for small, focused debugging Great for stuff like "Am I even calling this function correctly? Because I don't see any syntax errors listed in the Console but it never seems to run??!?!?!!?" Logging is better for bigger problems because it's less intrusive Logging can be left in the code just in case something goes wrong You can then disable logging when you deploy it onto your production web server (i.e., the server that the customers will use) See http://stackoverflow.com/questions/1215392/how-to-quickly-and- conveniently-disable-all-console-log-statements-in-my-code for suggestions on how to disable logging Even if you leave the logging in by accident your customers won't (normally) see the messages (unless they open up their Developer Tools panel)

Using alerts/logging to debug a program: Adding two numbers Look at debugging_01.html Stuff to watch for: Alert vs. log Notice that num1AsString is undefined Notice that the numbers are concatenated (glued together) instead of added up Notice that we we're using this operator even though we haven't covered it in class yet. While we will cover it some later your first response here should be "Gee, I guess I need to know more about that so I guess I'll start searching the web for JavaScript addition doesn't add and then go from there!"

Do Exercises #1 - 4

Semi-Independent Debugging Investigation

Looking for more debugging tips Debugging is an open-ended activity It's very hard to teach as a predictable, reliable, step-by-step process Each problem could be unique. Each problem could be a duplicate of something you've seen before Each problem could be somewhere in between Let's look through several pages together to get a feel for what people suggest and how to read technical stuff that you find online

Looking for more debugging tips http://www.webmonkey.com/ 2010/02/javascript_debuggin g_for_beginners/ Lots of good advice (keep the console open for errors, etc, etc) Assertions Alert Alert vs. logging 'self-narrating' code http://stackoverflow.com/que stions/988363/how-can-i- debug-my-javascript-code http://www.w3schools.com/js/ js_debugging.asp Debugger window (F12 key) Console.log Debugger keywork Not actually all that great 

Do Exercise #5