updating javascript snippets