Where can I add this jquery code to apply to a view block?
One quick way could be to add it inline in a preprocess function.

    /**
     * Implements template_preprocess_views_view().
     */
    function THEMENAME_preprocess_views_view(&amp;$vars) {
      $view = $vars['view'];
      // Add Javascript when the view with the name news is shown and the display id is your-display-id.
      if ($view-&gt;name == 'news' &amp;&amp; $view-&gt;current_display == 'your-display-id') {
         drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline');
      }
    }


If you prefer you could also add it as a file that you store in your theme. This would include a file called myfile.js under the folder for your theme /js

    /**
     * Implements template_preprocess_views_view().
     */
    function THEMENAME_preprocess_views_view(&amp;$vars) {
      $view = $vars['view'];
      // Add Javascript when the view with the name news is shown and the display id is your-display-id.
      if ($view-&gt;name == 'news' &amp;&amp; $view-&gt;current_display == 'your-display-id') {
         global $theme_path;
         drupal_add_js($theme_path . '/js/myfile.js');
      }
    }