moves javascript to file