JavaScript Programming: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Hints and tips for Javascript programming.
The best documentation on JavaScript available on the Internet is the one on the [http://developer.mozilla.org/en/docs/JavaScript Mozilla development center.] All the other sources are just not worthy and full of errors.


== Hints and Tips ==


* '''Deleting options in a select element (in a form):'''
* '''Deleting options in a select element (in a form):'''
Line 14: Line 15:


will display all the elements of the array, separated by commas.
will display all the elements of the array, separated by commas.
== JavaScript Libraries ==
* [http://www.fckeditor.net/ FCKeditor:] a rich text editor that can be integrated into any web page. Integration is really easy, at least for a PHP environment.

Revision as of 11:06, 21 March 2007

The best documentation on JavaScript available on the Internet is the one on the Mozilla development center. All the other sources are just not worthy and full of errors.

Hints and Tips

  • Deleting options in a select element (in a form):
document.my_form.my_select.options[index] = null;

Note that this syntax probably also works for other arrays of objects (untested yet, though).


  • Outputting quickly (for debugging) an array:
alert(my_array);

will display all the elements of the array, separated by commas.

JavaScript Libraries

  • FCKeditor: a rich text editor that can be integrated into any web page. Integration is really easy, at least for a PHP environment.