Adding element to category but not to subcategories or articles

Hi everybody.

I am trying to find the way to insert a js file in a category but not in the articles in it.

Thus adding it to category-a, but not to category-a/whatever-article-might-be-published-here

I have tried with “if” and strpos functions with no result at all.

Some idea???

Can this be done by analysing the URL to see what ‘level’ the page is, like the CSS thing? Or is it a different set of criteria other than just looking at the level within the site structure?