Problem:
Load an external js file when page contains a view
Solution:
You should have to build an array of page IDs where you added your view and then use that array with if condition to check if current post/page ID is available with the array value, then you can enqueue the js.