Add update function template for javascript.