ok, I figured out what was wrong. It had nothing to do with the pages, rather the .js file. As this was my first time with these files, I read keep all code inside <!-- and --> tags
Well, the thing is, I did this:
code:
<!--
javascript code
-->
<!--
another code
-->
When it should have only been
code:
<!--
javascript code
another code
-->
Thanks for the help anyway