chapter 3(is245)

30
Modern JavaScript Develop And Design Instructor’s Notes Chapter 3 – Tools of the Trade Modern JavaScript Design And Devel Copyright © 2012 by Larry Ullm

Upload: ashhab-mahdi

Post on 05-Feb-2016

16 views

Category:

Documents


0 download

DESCRIPTION

Semo is 245

TRANSCRIPT

Page 1: Chapter 3(IS245)

Modern JavaScriptDevelop And Design

Instructor’s NotesChapter 3 – Tools of the Trade

Modern JavaScript Design And DevelopCopyright © 2012 by Larry Ullman

Page 2: Chapter 3(IS245)

Objectives• Understand what the key features

are of development software• Describe the pros and cons of text

editors vs. Integrated Development Environments (IDEs)

• Know what to look for in a browser as a development tool

Page 3: Chapter 3(IS245)

More Objectives• Name the five most popular browsers• Recall the common debugging tools

available to the most popular browsers

• Write and test JavaScript code using online services

• Identify the general types of JavaScript errors

Page 4: Chapter 3(IS245)

More Objectives• Name many common causes of

errors• Utilize a wealth of debugging steps

and tools• Use JavaScript code to debug

problems• Use Firebug for advanced debugging

Page 5: Chapter 3(IS245)

Development Software• Coding• Executing• Debugging

Page 6: Chapter 3(IS245)

Choosing Software• Operating System• Language(s) supported• Specific Features

Page 7: Chapter 3(IS245)

Syntax Highlighting

Page 8: Chapter 3(IS245)

Code Intelligence• Auto-balancing of characters and

tags• Code completion• Tracking of variables and functions

Page 9: Chapter 3(IS245)

Other Features• Inline execution of code• Page templates• FTP support• Built-in debugger• Network monitor• WYSIWYG• Help system, manual, and documentation

Page 10: Chapter 3(IS245)

Coding SoftwareText Editors• Cheaper• Simpler• Easier to master• Faster to begin using• Less demanding of the

computer• Can be used for many

tasks

IDEs• More expensive• More complicated• Requires more computer

resources• Tend to be more specific• Better code intelligence• Better debugging• Faster development

once mastered

Page 11: Chapter 3(IS245)

Coding SoftwareText Editors• Komodo Edit• UltraEdit• Notepad++• EditPlus• TextMate• TextWrangler• BBEdit• Emacs• Vim

IDEs• Adobe Dreamweaver• Komodo IDE• Aptana Studio• Eclipse• NetBeans• WebStorm

Page 12: Chapter 3(IS245)

Executing Software

Page 13: Chapter 3(IS245)

What to Look For• DOM Inspector• JavaScript source viewer• Advanced JavaScript debugger• Network monitor• Error console

Page 14: Chapter 3(IS245)

Chrome• Web Developer• Pendule• Firebug Lite• JavaScript Tester• Validity

Page 15: Chapter 3(IS245)

Firefox• Firebug• Web Developer• YSlow!• Greasemonkey• View Source Chart• JS View

Page 16: Chapter 3(IS245)

Internet Explorer• IE Developer Toolbar• Web Accessibility Toolbar

Page 17: Chapter 3(IS245)

Opera

Page 18: Chapter 3(IS245)

Safari

Page 19: Chapter 3(IS245)

Complete Testing• Browsershots• Adobe BrowserLab• Virtualization Software• Spoon• Commercial Online Services

– CrossBrowserTesting– BrowserCam– Sauce Labs

Page 20: Chapter 3(IS245)

JS Bin

Page 21: Chapter 3(IS245)

General Error Types• Syntactical• Run-time• Logical

Page 22: Chapter 3(IS245)

Common Causes• Case Sensitivity• Improper Syntax• Misuse of = and ==• Referencing objects that don’t yet

exist• Treating objects as the wrong type

Page 23: Chapter 3(IS245)

Debugging Techniques• Get a good text editor or IDE.• Get a good development browser.• Keep the error console open!• Validate your JavaScript code.• Rubber duck debugging.

Page 24: Chapter 3(IS245)

Debugging Techniques• Use external JavaScript files• Save the file and refresh the

browser.• Try a different browser.• Take a break!

Page 25: Chapter 3(IS245)

Bad Debugging Techniques

• Panicking!• Ignoring error messages• Trying random solutions• Sending emails to teachers and

writers out of frustration

Page 26: Chapter 3(IS245)

Debugging with alert()

alert('Now in the XXX function!');

Page 27: Chapter 3(IS245)

Debugging with console()

console.log('Now in the XXX function!');console.log('myVar is ' + myVar);

Page 28: Chapter 3(IS245)

Debugging with Firebug

Page 29: Chapter 3(IS245)

Debugging with Firebug

Page 30: Chapter 3(IS245)

Debugging with Firebug