in reply to javascript inside HTML::Template file

Remember that the mere presence of a script-tag does not mean that the contents of the tag will be immediately executed by the browser.   Most browsers have a debugger, either built-in or as a plugin.   (You might have to click on an intentionally-obscure preferences checkbox to turn it on...)   Armed with this information, you can see what the browser is doing.   As others have said, tutorial/background info about the subject might be needed ... and <understatement size="infinity">not all browsers (heh...) are the same.</understatement>