However for anything on the web, this is not possible. Like @TheDoc says, you should minify it anyway, and then it will be more difficult to figure out. For example, let’s take one of my own plugins.
That’s pretty easy to figure out, or steal/copy and then modify, etc. But this is the source code, not that script that you should actually use.
For that, I would recommend the minified version of the same script: http://github.com/senff/Sticky-Anything/blob/master/jq-sticky-anything.min.js
That’s a lot more complex to understand right away. It can still be “untangled” but it’s an extra layer, in a way.
So, I agree with the people above that it’s useless trying to figure out how to protect your code. But what’s more important is that you should trust your users a little bit more.
That theory sounds good but in reality it’s not like I could sue or enforce 250,000 different people who stole my work…
What golden jackpot idea do you have in mind that is so good that hundreds of thousands of people want to steal it?
If I sell something for $45 or $50 bucks but it’s all open source code I don’t see many people paying for it if they can easily steal it.
I disagree. People will pay, as long as it’s actually good software that’s worth the price. Trust your customers a little more. With software like this, it’s not like music or movies. The “why pay if I get it for free?” doesn’t really apply here.
And hey, I consider being pirated an accomplishment, to be honest. I came across a site the other day where paid WordPress plugins are being offered for free. One of my own plugins was among them….and I’m actually flattered that they deemed my plugin good enough to pirate. :)