Is it possible to hide the Javascript code from the html of a webpage, when the source code is viewed through the browsers View Source feature?
I know it is possibl
Approach i used some years ago -
We need a jsp file , a servlet java file and a filter java file.
Give access of jsp file to user. User type url of jsp file .
Case 1 -
Using Printwriter , it will render the response to user .
Meanwhile, Servlet will create a key file .
When servlet try to execute the xxxx.js file within it , Filter
will activate and will detect key file exist and hence delete key
file .
Thus one cycle is over.
In short ,key file will created by server and will be immediatly deleted by filter .
This will happen upon every hit .
Case 2 -
Instead of File creation , one may use setting value in session variable .