How do i insert Javascript into a Topic?

You add JS to a theme, and on the JS code you can target specific categories or topics using DOM selectors.