outsource javascript code