Created
May 24, 2017 18:40
-
-
Save apphp/01112e306e574dc39de868af2383e0ac to your computer and use it in GitHub Desktop.
This snippet code allows you to prevent the viewer from being able to right-click on your page. This can discourage the average user from borrow images or code from your site.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// source: www.apphp.com/index.php?snippet=javascript-display-random-quotes | |
writeRandomQuote = function () { | |
var quotes = new Array(); | |
quotes[0] = "Action is the real measure of your intelligence."; | |
quotes[1] = "The baseball has a great advantage over cricket of being sooner ended."; | |
quotes[2] = "Every goal, every action, every thought, every feeling one experiences, whether it be consciously or unconsciously known, is an attempt to increase one’s level of peace of mind."; | |
quotes[3] = "A good head and a good heart are always a formidable combination."; | |
var rand = Math.floor(Math.random()*quotes.length); | |
document.write(quotes[rand]); | |
} | |
writeRandomQuote(); | |
</script> | |
<script type="text/javascript">writeRandomQuote();</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment