Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Javascript
I put a Javascript into a JS file,and refered it in a HTML file.
This Javascript includes sensitivity information
such as the
Next page Path and File Name,
some result that will be stored in Array,
and Logic.
I know people can get this JS file information by choosing View Source Code or Download this JS file via Save As page option. so
How do i protect the JS file source?

Any idea will be appreciated!Thumbs Up | :thumbsup:
Posted 2-Nov-10 20:03pm
Edited 2-Nov-10 20:07pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I Think it's not possible to restrict JS file from downloading, You can have another alternate option to store sensitive data rather then JS.
See THIS[^] thread which might be useful for you.
Please vote and Accept Answer if it Helped.
Sunasara Imdadhusen at 3-Nov-10 2:25am
Ya i understand, but i want to Encrypt JS file, so no body could read it easily.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Give read permission on that folder.
you can use following link
Protects JavaScript code from stealing and shrinks size

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 377
1 Nirav Prabtani 284
2 Richard Deeming 190
3 _Amy 170
4 Mehdi Gholam 140
0 Nirav Prabtani 265
1 OriginalGriff 177
2 _Amy 170
3 Mehdi Gholam 105
4 Maciej Los 90

Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 27 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100