update javascript snippets