update post javascript