Function from included file not responding

Its really unusual.

From a click event I’m calling a javascript function -

 <a href="<?php echo $fetch_loc1['url']; ?>" onclick="showUser(<?php echo $idC; ?>)" target="_blank">View More</a>

if the function is written in same page it is calling, but if I include function in different page(here in selectuser.js file) -

<script type="text/javascript" src="selectuser.js"></script>

, then it is not responding.

Expecting your help and will greatly appreciate.


A very important things I learned. I knew it before but never expect to apply here.

Need to use <script type=“text/javascript” src=“”></script>

Interestingly, in the same server, I find both syntax working…