Author Topic: jQuery [Protect copyright]  (Read 1197 times)

0 Members and 2 Guests are viewing this topic.

Offline Code.Illusionist

  • Royal Highness
  • ****
  • Posts: 687
  • Cookies: 39
  • Compile or die trying
    • View Profile
jQuery [Protect copyright]
« on: May 25, 2013, 08:27:13 pm »
Hi there Evilzone members. I think this is pertty simple way to protect your copyright text on web page from people who often download page and change copyright. I must add that the code itself is very simple and if someone knoe jQuery, he will delete it of course. But, for those who just download templates and change copyright like they did it, I am sure they will never notice this. Anyway here is the code:

HTML:
Code: [Select]
<html>

<head>
<script src="jquery.js"></script>
</head>
<body>
<p id="copyright">Copyright &copy; Ripper</p>
</body></html>
jQuery code to add in head tag:
Code: [Select]
<script>
$(document).ready(function() {
var text =  $('#copyright').html();
if (text != "Copyright &copy; Evilzone") $('#copyright').html('Copyright &copy; Evilzone');
});
</script>
All it does is checking if variable text (value of that variable is paragraph html) is equal to something we want it to be. If it's not, it's instantly changed to what we wanted from the start. I know it's nothing special, but I wanted to share it with you because it can be interesting.

Vae Victis - suffering to the conquered

Offline wookie

  • Peasant
  • *
  • Posts: 68
  • Cookies: -4
    • View Profile
Re: jQuery [Protect copyright]
« Reply #1 on: May 26, 2013, 07:04:00 am »





On a serious-ish note, you would likely return a JS error in reality, because in reality they entire container of #copyright would be removed, not just the text inside it, and therefore you should check to see if $("#copyright").length > 0 or something to that effect and append it to the DOM.

Offline Code.Illusionist

  • Royal Highness
  • ****
  • Posts: 687
  • Cookies: 39
  • Compile or die trying
    • View Profile
Re: jQuery [Protect copyright]
« Reply #2 on: May 26, 2013, 09:46:55 am »
You see, I didn't changed copyright DIV, I have changed paragraph ID called copyright. So, it's completly easy to change it. Paragraph itself can be placed anywhere. :)
Vae Victis - suffering to the conquered

Offline wookie

  • Peasant
  • *
  • Posts: 68
  • Cookies: -4
    • View Profile
Re: jQuery [Protect copyright]
« Reply #3 on: June 02, 2013, 07:47:18 am »
You see, I didn't changed copyright DIV, I have changed paragraph ID called copyright. So, it's completly easy to change it. Paragraph itself can be placed anywhere. :)


But you're assuming it exists... it probably won't if someone has "stolen" your source code...

Offline Code.Illusionist

  • Royal Highness
  • ****
  • Posts: 687
  • Cookies: 39
  • Compile or die trying
    • View Profile
Re: jQuery [Protect copyright]
« Reply #4 on: June 04, 2013, 10:17:14 am »
In case someone is changing copyright, I guess he would only change text, not the whole copyright part. Just no sense. Those who know to code wouldn't take template in first place.
Vae Victis - suffering to the conquered