in reply to call js function from CGI?

Where do you want the Javascript to execute? Do you want it to execute on the server or in the browser?

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?