Javascript code

Discussion in 'JavaScript' started by bEvolution, Sep 29, 2008.

  1. #1
    Hello people, I just started to learn javascript, and I really like it. I have created a nice web application with full javascript, my first one :D
    But I just noticed that anyone, can see the code.
    Is there a way to hide the js code? maybe using a framework like mootools or jquery? Or with php?
    Thank you in advance!
     
    bEvolution, Sep 29, 2008 IP
  2. webcosmo

    webcosmo Notable Member

    Messages:
    5,840
    Likes Received:
    153
    Best Answers:
    2
    Trophy Points:
    255
    #2
    javascript is a client side code, you really can't effectively hide it.

    lot of people really thought about hiding it. seriously I would say don't waste your time thinking of it:)
     
    webcosmo, Sep 29, 2008 IP
  3. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #3
    use a js file to hold your javascript
    <SCRIPT LANGUAGE="JavaScript" SRC="myscript.js">
    </SCRIPT>
    Code (markup):
    Then compress it with site like these http://dean.edwards.name/packer/
     
    javaongsan, Sep 29, 2008 IP
  4. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can obfuscate it but there is no way to truly hide it, no matter what anyone says.
     
    MMJ, Sep 30, 2008 IP
  5. bEvolution

    bEvolution Peon

    Messages:
    458
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I am making a javascript site that uses Google Maps, I don´t want everyone to see how to create the maps I´m going to provide. Maybe with an XML?
    Or at least make the job hard to possible copycat.
    I was also thinking to make my own framework...
    Can´t believe there isnt a way to protect my JS code.!
     
    bEvolution, Sep 30, 2008 IP