I have built a new jQuery plugin and I want to be able to demo this to the user before they can purchase this. But I also don’t want anybody to be able to simple copy the code without paying for it.
For that reason I have encoded the plugin using http://www.vincentcheung.ca/jsencryption/
I thought of 2 ideas to further protect/make it harder to copy:
- Hard code the domain name check against
window.location.hostname - Using AJAX send as much information about the website back to a PHP script on my server.
What extra information can be fetch using Javascript apart from the domain name. E.g. PHP you have the $_SERVER[].
Do you have any ideas to protecting it further?
Ok I just have just wrote this myself and this, seems to work on two different domains.
$.ajax({
url: 'http://example.co.uk/record.php',
type: 'post',
data: 'href='+document.location.href + '&referrer='+document.referrer
});
Record.php
mysql_query("INSERT INTO `demo` (`id` ,`datetime` ,`href` ,`referrer`)VALUES (NULL ,CURRENT_TIMESTAMP , '".$_POST['href']."', '".$_POST['referrer']."')");
I don’t think you can do that. If you want to demo to the user, just record a movie of it in action. Most of the websites do it like this.