Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Jul 2010
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post

    Question how protect external javascript

    hello,
    I have designed a web site. but I want to protect my external javascript(and css also) from outside people, who steal my javascript.

    can anyone tell me a method to hide external javascript(and css) from these knaves...!!!


    thank you

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You don't. Don't waste your time.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Jul 2010
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post
    Oh! don't!

    can't we get some assistance, at least from sever-side languages ?

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Nope. If the browser can see it, so can the user. Read this thread.

    http://www.codingforums.com/showthre...&threadid=4437
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Jul 2010
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post
    yaa! that's disable right click.
    as you said, it can't be hide external javascript from user.

    but can it be like this,

    • instead of hide javascript in the header part, we can hide the code in the body part using echo which is calling the javascript

    • then, when someone download the page to local computer, it will not work without that part which we hide using echo.


    as an example,

    instead of
    Code:
    <td width="53%"><div align="center">
            <script type="text/javascript">new inter_slide(slides)</script>
    </div></td>
    can use like this code(this is not working.may be this code is wrong)
    <td width="53%"><div align="center">
    <?php echo "<script type="text/javascript">"."new inter_slide(slides)"."</script>" ?>
    </div></td>
    can I achieve my target from like this code?

    I tried this several times but I couldn't. so I hope you will help me.

    thank you.

  • #6
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Sir, JavaScript is a client-side language. That means the code is loaded into the client's browser's cache, no matter it is a local code, an embedded code or an external code. So that there is no way to hide a client-side code, JavaScript included. Period. You may encrypt it, maybe, on using a cipher algorithm, but the encrypting key is open, as well, so that a good programmer will decipher it, sooner or later. That is all you can do.
    Last edited by Kor; 07-21-2010 at 08:23 AM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #7
    hgs
    hgs is offline
    New Coder
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    80
    Thanks
    3
    Thanked 5 Times in 5 Posts
    You just can obfuscate ... read here

    http://yuiblog.com/blog/2006/03/06/m...v-obfuscation/

  • #8
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by hgs View Post
    You just can obfuscate ... read here

    http://yuiblog.com/blog/2006/03/06/m...v-obfuscation/
    Yes, but for every obfuscator there is an unobfuscator as well

    All you can hope is to make the thief's life as harder as possible. But you can not 100% protect your code.

    After all, this effort to find a way to hide a code will do nothing but to make your life harder. You will spend your time and nerves for almost nothing.

    Think a little bit, M rosi. Who would and could steal your code? Experienced coders, right? Beginners or ordinary people will not be able to understand the code, so that they are out of the discussion. But, on one hand, the experienced coders have no interest to steal your code, because they are experienced, so that they are able to create their own codes. On the other hand, an experienced coder knows that it is harder to modify somebody else's code than to create your own code.

    Let's still say that an experienced programmer wants to steal your code. He will steal it by all means, because he is experienced.

    It's like the well known paradox: Humans have no chance to defeat some much more technological advanced Aliens: either they will not attack us, as they have superior minds and they learned that war is useless, or they will attack us, but they are superior and they will defeat us. So that the Humans should stop being paranoid about that.

    My advice: just focus your mind and energy on your code problems and forget about the "how to hide my code?" impossible task. You will save time, money and nerves
    Last edited by Kor; 07-21-2010 at 02:15 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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