Reference external JS and write JS in page