I want the javascript loaded only on the domain that I specify, while if it is loaded by another domain, the page will be directed to the domain that I specify.
for example, I have a page in domain mydomain.com
with some javascript there, then someone copy that javascript from my page and load it in hisdomain.com
. Because I have set the script to function only in the domain mydomain.com
, so the script will not work in hisdomain.com
. Besides, it would be better if hisdomain.com
redirected to mydomain.com
.
I want to use this method to avoid theft and cloning scripts by people who are not responsible.
Thank you!