Hooking up the javascript to the controller