How to write code using JavaScript
Initial Setup
- Have a copy
of the JavaScript reference and/or the W3Schools
JavaScript tutorial easily available.
- Download/Open your favorite JavaScript text editor
(JEdit works well :
http://www.jedit.org/index.php?page=download)
- Download/Open your favorite JavaScript enabled web
browser (Firefox has a good debugger :
http://www.mozilla.com/en-US/firefox/)
- Open your web browser’s debugger window
- Write down your programming algorithm in English,
expanding the detail as needed. (This is your pseudo
code)
- Break your program down into smaller manageable parts
(functions, statements, display, program logic,
etc…)
-
The dirty work – Rinse, Wash, Repeat
- Text
Editor : write a small section of your program,
converting your pseudo code into JavaScript using the
references for assistance.
- Text
Editor : Save
- Web Browser : Open your .html file and
debugger
- Web Browser : Did you get what you were expecting
with no errors?
- If no
-
- Text
Editor : Verify correct JavaScript syntax, verify
algorithm is correct
- Text
Editor : Make ONE change to your code and hit
save
- Web Browser : Clear your debugger
and reload your page
- Web Browser : Did you remove the
errors? : If no – repeat A – C
- Save a backup of your work to your dante
account.
- Figure out what logical piece must be written
next (often times this “plugs in” to the
previous section)
- Repeat 1 – 7 until finished