SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using Ajax to hide JavaScript

    H there,

    I am about to launch a site for which I have done a large amount of work in Ajax. Probably about 60% of my work is on the client side in JavaScript. I am considering taking some of the larger functions (where I have done most of the owrk) out of the static html page and passing them to the browser at runtime and then using eval to execute them.

    I was wondering if anybody has ever done this before and how much protection this actually gives from somebody who would want to see my code.

    Thanks in advance.

  2. #2
    SitePoint Addict ALL's Avatar
    Join Date
    Oct 2005
    Location
    South Dakota
    Posts
    215
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    almost none... if i wanted to see js code i would just open the page in firefox, then change with my web developer plugin i would view all javascript files. or i could force an error in the js and debug it to view all the info being moved around...

    What do you want to protect your code against? because if you put a note in the code at the very beginning saying "you are strictly forbidden to copy or other wise minipulate this code" you have the ability to sue a person if they tried to steal it.

    If there is another reason you want to parse the js, i seggest you use a server side language and output it as XML or another format where they cant see the js.

    Another idea would be to use flash, it is still not too get the code, but better than js.

    -ALL
    Did I help you?
    You can repay me, support one of my projects (no money needed):
    JavaScript Wiki, Another Web Forum, Paranormal Site

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    UK
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you have to give the code to the browser in order for it to be able to execute it

    if you give it to the browser, then anyone can get at it

    you can never stop this... it's client-side code!

  4. #4
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you could do is to obfuscate your JavaScript to make it more difficult for others to use. Google for "JavaScript obfuscate".


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •