You can output JS (in script tags) anywhere throughout the theme. The best place would be in the 'head_script' method.
public function head_script() { parent::head_script(); $this->output_raw('<script>your code here</script>'); }
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.