Move js to a separate file