In this article I will explain how we can find errors and
this mistake is known as bug and the process of finding and fixing bug is know
as debugging. Debugging is a normal part of development process.
errors which are encountered:
1) Syntax errors: A Syntax error refers to simple errors
in code such as missing parenthesis etc.
2) Runtime errors: Runtime errors are that error which
mistakes such as variable not declared but we are trying to access it.
3) Logical errors:
This errors is related to the logic,
our program will compile and run but it will not give the correct output, as it
must give. This type of errors are most difficult to find.
How to turn on the error message in
By default Internet explorer shows an error icon in the
status bar if any error occurs or we can turn on this option from browser.
To enable this option in Internet explorer, Tools >> Internet Option>> Select
We can check this checkbox to enable the error message
Error Message in Mozilla Firefox:
Other browser such as Mozilla,
We can view the console, select
These browsers give no indication
when an error occurs; we have to keep the console open to view where error has
This is a console window which
contains all the errors which are encountered during execution of script.
The error Notifications which
shows up contains syntax errors as well as runtime errors.
is valid or not and syntax is valid or not. These programs comes with commercial
How to Add Debugging code to our program:
We can manually insert alert() or document.write method to
debug our code so that we can see the order of execution of our code and can examine where the errors appear.
Debugger, a debugger is an application that places the script execution under
the control of the programmer. Once the script is loaded into the debugger then
we can examine code line by line and checking the state of variables
In this article I explained
and fix it through one of the debugging techniques.