1. Click on the 'Modules' menu link in the Drupal administration section.
2. Scroll down until you find the 'PHP Filter' module. Check the box next to it. Click 'Save.'
3. Click on 'Structure,' then 'Blocks.' Select 'Add New Block,' or click on 'Edit' next to the block where you want to add the JavaScript.
4. Select 'PHP' beneath the Body box, then paste or type the JavaScript code into the box. Click on 'Save Block.'