updating javascript snippets.