Select to view content in your preferred language

Javascript Security

562
2
09-26-2012 06:45 AM
GaneshUpadhyay
New Contributor
Hi

Kindly let me know how can i secure my javascript code in arcgis from external viewing. I want to hide all code so that no user can misuse it.

Looking forward for reply

Thanks
0 Kudos
2 Replies
JeffJacobson
Frequent Contributor
You can't "hide" the code.  The client (browser) HAS to download the JavaScript code in order to run it.

The closest you can come is to minify your JavaScript code.
0 Kudos
StephenLead
Honored Contributor
You could also try obfuscating your code to make it a bit harder to access, but the reality is that given enough effort, someone will be able to access your JS code. An alternative is to use the Flex or Silverlight APIs.
0 Kudos