Updated javascript snippets.