If I call a Javascript file, is that code visible in the browser (browser)?

Asked

Viewed 81 times

4

I know that when I write code directly into HTML pages Javascript is shown but what if I call only the file, for example, like this

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

The code will be shown?

2 answers

8


Yes, there’s nothing I can do to stop this. Take the test.

  • How I can protect script code from being copied?

  • then and if ajax is javascript the ajax also be visible?

  • 2

    Javascript will be visible, AJAX is just a way to use JS. The statement makes no sense. It is not possible to protect the code, at most to make it difficult, but there is another question and it has already been answered: http://answall.com/q/7257/101

  • 1

    Forget about protecting, it’s a waste of time.

2

Hello @Amadeuantunes it will not be shown in the code, but who can see the directory (link) where the file is, will be able to see the code.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.