title: Javascript protection
body: <p>I know this is kind of stupid, but I need to protect a javascript, in a sense that I wish to add as much security as possible so that it is not pirated. Well, because it the core component of the system. I plan to use YUI compressor to compress and obfuscate it. </p>
  
  <p>But I would also like to add a protection which checks the domain, if the domain matches then its fine else it will simply exit.</p>
  
  <p>What other protection methods would you suggest? How do I make it such that people purchase the script (very cheap) instead of copying it directly etc.</p>
  
  <p>Thank you for your time.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Just thought I'd add that the package also contains a PHP file without which it can't work really. Unless someone sees what kind of JSON data the script is exchanging and then recreates the PHP file.</p>