add functions on post javascript