alreaday in your java script file, you have a method. right.
In your html file,----
< script src="test.js" > testAlert();
< /script >
---don't know weather it is right or wrong, but
as far as I know,
you need not mention the method name, instead, you just say
< script src="test.js" >< /script >
in your html file and call the method.