Javascript procedures are registered by using the websDefineJst API. This publishes a C procedure as a Javascript global function. For example:

extern int outputMyTable(int ejid, Webs wp, int argc, char **argv);
websDefineJst("outputTable", outputMyTable);

The websDefineJst call publishes the Javascript command "outputTable" and links it to the outputMyTable C procedure. When an JST page is requested by the user's browser, any JST Javascript which uses the outputTable command will cause the outputMyTable to be called with the relevant arguments.