adds js file for each page and attaches to html files