put the javascript code into the class