Updated the javascript snippets.