If I call a JavaScript file, is this code visible in the browser?

4

I know that when I write code directly in HTML pages JavaScript is shown but what if I just call the file, for example,

<script src="script.js"></script>

Will the code be shown?

    
asked by anonymous 06.10.2015 / 17:52

2 answers

8

Yes, there is nothing you can do to prevent this. Take the test.

    
06.10.2015 / 17:57
2

Hello @AmadeuAntunes it will not be shown in the code, but anyone who can see the directory where the file is located will be able to see the code.

    
06.10.2015 / 18:11