Adds procedure to JavaScript

Adds a procedure to the JavaScript file.