JavaScript Programming
Jump to navigation
Jump to search
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.
Preloading Images
- Note that once an image is preloaded, you must attach it to the document somehow. Else it seems Firefox can somehow 'forget' it, and it will be fetched again, thus you lose the benefits of preloading.
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.
- Warning: due to a strange encoding of the source files on the package, it seems some UTF BOM characters are present. This causes some weird character output when using PHP integration (at least, untested with other environments). Remove these strange characters from the PHP integration files (fckeditor.php and all).
- By default, FCKeditor converts the latin characters directly to HTML entities (eg, é is converted to é). To disable that, set IncludeLatinEntities to false in the configuration (the file fckconfig.js).
FCKConfig.ProcessHTMLEntities = true ; FCKConfig.IncludeLatinEntities = false ; FCKConfig.IncludeGreekEntities = false ;