How to add JavaScript to a specific View if I don't know the node? I've seen the answer here using the NID but I don't know this, I only have the URL. Is there is another way to do this please?
function MY_THEME_preprocess_node(&amp;$vars) {
    if($vars['nid'] == 'XX'){
      drupal_add_js('path/to/js/file.js');
    }
}
Check out hook_views_pre_render https://api.drupal.org/api/views/views.api.php/function/hook_views_pre_render/7.x-3.x
That provides a view object where you could retrieve the machine name of your view and add your drupal_add_js when its the relevant view being loaded