The javascript in the templates should all be contained within a file and linked with a script tag, not inline.