Documentation for JIRA 4.4. Documentation for other versions of JIRA is available too.
Please note that adding Javascript to custom fields is a customisation and not maintained as a supported part of JIRA.
There are several ways to inject JavaScript or HTML into JIRA: