Add JS to templates