Friday, November 9, 2007

Useful javascript Snippets

Just a collection of javascript code that I find useful.
As I don't know much javascript code yet, I hope to add more to this list as i find more useful stuff.

alert() : alert('string or '+variable);
Alert can be pretty useful when debugging your code. Throw one in to see a variable's value or into a function and if/else statements to see if the code is executing. Alert has lots of good uses. One note here though; if there are a lot of things you need to debug, you should use document.write to a text area in your project instead.

I hope to add more soon and feel free to contribute some of your own.

No comments: