#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    42
    Rep Power
    12

    Encrypting JavaScript without JS file


    I wanted to know if there is wa way to hide JavaScript code from the browser. I created a simple online exam and I decided to validate it with JavaScript...but there is one small problem...when the source is viewed the answers can be viewed as well. Is there a way to hide this without having to change it to a JS file???
  2. #2
  3. No Profile Picture
    CF sMod
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Maine, USA (a.k.a. Boonies)
    Posts
    242
    Rep Power
    14
    You can't effectively encrypt any source code, at all.
    Jason Contact Me
    Super moderator @ CodingForums
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    19
    You could try this:
    http://www.iwebtoolkit.com/tools/html-encrypt/

    It's not fool proof, but will make people work to see your code.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Location
    Norway
    Posts
    34
    Rep Power
    12
    You should validate the answers with server-side scripts. Then the source code can't be viewed. And no, you can't hide the JS file.

IMN logo majestic logo threadwatch logo seochat tools logo