I want to include an optional template part in the theme which requires some jQuery plugin. Is it ok to include the wp_enqueue_script in that specific file? Or it should always be included in the functions.php file?
Also, is it ok to write some javascript code in that specific file? The script works, but my question is about WordPress coding standard.