Adding javascript to a view?
Why do you need a javascript way explicitly? Drupal can do these Filters and make the glossary view, an index by letters, at top for you already in the views administration area.