javascript & security

They have: 330 posts

Joined: Apr 2000

Are there any tricks to stopping other developers from stealing your javascript code?

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

the only 100% protection is not posting it.

There are schemes and tricks to make it harder to get and to read, but nothing to completely block it.

-Greg

They have: 330 posts

Joined: Apr 2000

That is what I am looking for. I want to put something in place that makes it somewhat of a challenge for whoever is reading the code. This way anyone who steals it is probably smart enough to write it themselves if they wanted to.

Can you provide me with some examples or point me to a website that talks about tricks to make it harder to read?

Busy's picture

He has: 6,151 posts

Joined: May 2001

Some of these tricks can effect your pages load time as the browser has to translate the code first.
If possible use server side

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

I agree with Busy and Greg K here, if you're scared of people stealing your code, either use a server side language like PHP or, don't put it up at all.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Agreed, there truly is no way of protecting client-side code also many of the methods (disabling right-clicks for instance) can very much inhibit the users experience and cause frustration.

As the others suggested, if you don't want others looking at your code then do it server-side. Or you could use a Creative Commons License, let people use the code but retain your name and some of your rights etc.

a Padded Cell our articles site!

They have: 330 posts

Joined: Apr 2000

99% of what I do is in asp, so building this project in asp would have saved me many hours. The problem with server-side languages is every action requires a response back to the server. The project I am working on has hundreds of transactions, mostly automated based on the user's response, which would not work properly in a server-side environment.

I am looking into the license option. I know that will not stop anyone from stealing the code, but maybe it will ease my mind a little.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.