js update and template page