pull out the js code into a js file.