Instructional exercise 7 Investigating JavaScript Area A - Fundamental Troubleshooting Procedures.


96 views
Uploaded on:
Category: Sports / Games
Description
Instructional exercise 7 Troubleshooting JavaScript Area A - Fundamental Investigating Strategies. Instructional exercise 7A Subjects. Area A - Fundamental Investigating Procedures About troubleshooting ideas How to translate blunder messages How to follow mistakes with the ready() technique How to follow blunders with the compose() and writeln() strategies
Transcripts
Slide 1

Instructional exercise 7 Debugging JavaScript Section A - Basic Debugging Techniques JavaScript Tutorial 7 - Debugging JavaScript

Slide 2

Tutorial 7A Topics Section A - Basic Debugging Techniques About investigating ideas How to translate slip messages How to follow mistakes with the ready() strategy How to follow lapses with the compose() and writeln() systems How to utilize remarks to find bugs About extra troubleshooting strategies JavaScript Tutorial 7 - Debugging JavaScript

Slide 3

Basic Debugging Techniques Understanding Debugging Act of following and determining blunders in a project Three sorts of lapses Syntax Run-time Logic JavaScript Tutorial 7 - Debugging JavaScript

Slide 4

Basic Debugging Techniques Understanding Debugging Syntax blunders Occur when code is utilized that the mediator doesn’t perceive Examples: Invalid or inaccurate explanations Missing images (e.g., wavy prop) Incorrect spelling or mistypes Using distinctive situation when referencing variables JavaScript Tutorial 7 - Debugging JavaScript

Slide 5

Basic Debugging Techniques Understanding Debugging Run-time slips Occur when translator experiences code it can’t handle Examples: Call to capacity that hasn’t been characterized Referencing a variable that hasn’t been proclaimed Division by zero JavaScript Tutorial 7 - Debugging JavaScript

Slide 6

Basic Debugging Techniques Understanding Debugging Logic lapses Problems in the program\'s outline that keep it from running as foreseen Examples: Performing one operation when another is proposed e.g., duplicating as opposed to isolating Infinite circles JavaScript Tutorial 7 - Debugging JavaScript

Slide 7

Basic Debugging Techniques Error Messages Error messages are produced by the JavaScript mediator when it experiences a linguistic structure or run-time slip Unfortunately  not with a rationale error… Information showed in slip messages: Line number in archive where blunder happened Referenced from first line of record Description of the lapse JavaScript Tutorial 7 - Debugging JavaScript

Slide 8

Basic Debugging Techniques Error Messages Example: capacity missingClosingBrace() { var message = “Function missing brace.”; alert(message); JavaScript Tutorial 7 - Debugging JavaScript

Slide 9

JavaScript Tutorial 7 - Debugging JavaScript

Slide 10

JavaScript Tutorial 7 - Debugging JavaScript

Slide 11

Basic Debugging Techniques Error Messages In IE forms higher than 4: Must turn on blunder notice Tools menu  Options  Advanced In Browsing classification: Select “Display a warning about each script error” JavaScript Tutorial 7 - Debugging JavaScript

Slide 12

Basic Debugging Techniques Error Messages In Netscape adaptations that bolster JavaScript 1.3 and higher: Must turn on slip notice Tools and Tasks menu  JavaScript Console JavaScript Tutorial 7 - Debugging JavaScript

Slide 13

Basic Debugging Techniques Error Messages don’t dependably distinguish the real issue They ought to be utilized as a beginning stage for investigating Don’t accept that the issue is just with the line number demonstrated in the blunder message JavaScript Tutorial 7 - Debugging JavaScript

Slide 14

Basic Debugging Techniques Error Messages Web programs don\'t entirely uphold JavaScript grammar Programs may run despite the fact that they contain Bugs may not be perceived reliably crosswise over diverse programs JavaScript Tutorial 7 - Debugging JavaScript

Slide 15

Basic Debugging Techniques Error Messages How to relieve bugs in your projects Always utilize great sentence structure Be restrained in your programming procedure Thoroughly test your project in every single real program JavaScript Tutorial 7 - Debugging JavaScript

Slide 16

Basic Debugging Techniques Tracing Errors with the ready() Method If not able to find a bug utilizing lapse messages Must follow the code Tracing The examination of individual articulations in an executing system JavaScript Tutorial 7 - Debugging JavaScript

Slide 17

Basic Debugging Techniques Tracing Errors with the ready() Method ready() strategy gives a standout amongst the most helpful approaches to follow a system Process: Place a ready() strategy at the point in the project where you think the issue is found Move it as essential through the code until the issue is recognized or Place a few all through the system at one time JavaScript Tutorial 7 - Debugging JavaScript

Slide 18

JavaScript Tutorial 7 - Debugging JavaScript

Slide 19

JavaScript Tutorial 7 - Debugging JavaScript

Slide 20

JavaScript Tutorial 7 - Debugging JavaScript

Slide 21

JavaScript Tutorial 7 - Debugging JavaScript

Slide 22

JavaScript Tutorial 7 - Debugging JavaScript

Slide 23

Basic Debugging Techniques Tracing Errors with the compose() and writeln Methods Examine various qualities Alternative to single worth opening so as to utilize ready() system Create a rundown another window and utilizing compose() and writeln() routines to print qualities to it JavaScript Tutorial 7 - Debugging JavaScript

Slide 24

Basic Debugging Techniques Using Comments to Locate Bugs Comment out lines that may be bringing about issues Single proclamations Groups of articulations Combine investigating systems for more far reaching methodology JavaScript Tutorial 7 - Debugging JavaScript

Slide 25

JavaScript Tutorial 7 - Debugging JavaScript

Slide 26

JavaScript Tutorial 7 - Debugging JavaScript

Slide 27

Basic Debugging Techniques Additional Debugging Techniques Checking HTML Tags If JavaScript bug can\'t be discovered utilizing the systems said here: Check HTML code for mistakes Missing open/close sections Missing open/close labels HTML bugs by and large aren’t declared JavaScript Tutorial 7 - Debugging JavaScript

Slide 28

Basic Debugging Techniques Additional Debugging Techniques Analyzing your rationale If bug isn’t a language structure or run-time blunder: Check rationale Analyze every announcement on a case-by-case premise Use following to guarantee estimations of variables at particular focuses in the system JavaScript Tutorial 7 - Debugging JavaScript

Slide 29

Basic Debugging Techniques Additional Debugging Techniques Testing articulations with JavaScript URLs JavaScript URL Used for testing and executing JavaScript explanations without a HTML report or JavaScript source document Syntax: javascript:statement(s) Enter into the program Location or Address box JavaScript Tutorial 7 - Debugging JavaScript

Slide 30

Basic Debugging Techniques Additional Debugging Techniques Reloading a HTML archive Web programs can regularly neglect to reload an archive when coordinated to do as such Sometimes, you must, Reload or revive Re-open page Shutdown and revive program Clear reserve JavaScrip

Recommended
View more...