Adding JavaScript code to the examples.