6. DEVELOPMENT
Write JavaScript code
As quickly and efficiently as possible
Edit HTML and CSS
At least for reference purposes
Reference Javascript Documentation
Core language documentation
Jquery or other library documentation
16. DEBUG
Mozilla Firefox
Firebug
Venkman
IE 8
Developer Tools
Chrome/Safari
Developer Tools
JavaScript Console
Other
Firebug Lite
17. DEBUG
Firebug
http://getfirebug.com/
Features
Inspect and edit HTML
Tweak CSS to perfection
Monitor network activity
Debug and profile JavaScript
Explore the DOM
Execute JavaScript on the fly
Logging for JavaScript
20. LINT
What is JSLint?
JSLint is a JavaScript program that looks for problems in
JavaScript programs. It is a code quality tool. JSLint is a
JavaScript syntax checker and validator.
JavaScript is a sloppy language, but inside it there is an
elegant, better language. JSLint helps you to program in that
better language and to avoid most of the slop.
Warning!
JSLint will hurt your feelings.
JSLint
http://www.jslint.com/
JavaScript Lint
http://www.javascriptlint.com/
Google Closure Linter
http://code.google.com/closure/utilities/
22. SAMPLE JAVASCRIPT
/**
* Start Timer and update it
every 1/2 second
* Update the 'txt' HTML element
*/
function startTime()
{
var today=new Date();
var hour=today.getHours();
var min=today.getMinutes();
var sec=today.getSeconds();
// add a zero in front of
numbers<10
min=checkTime(min);
sec=checkTime(sec);
document.getElementById('txt').
innerHTML=hour + ":" + min +
":" + sec;
t=setTimeout('startTime()',50);
}
/**
* Check time and add zero in
from of needed
* @param {integer} i The time to
be formatted
*/
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}