Wednesday, October 1, 2014

Javascript Random Text (i.e. ZALGONATION)

What this does

This is a little thing I invented whilst reading about the String.fromCodePoint and the respective identity getter. By generating a random number (thanks to Mozilla.org's developer wiki for the code of generating random integer) between the range of the normal text's points (30 - 126), and repeating that a random number of times.
  1. window.setInterval(function(){
  2.         title = document.getElementsByTagName("title")[0]
  3.         title.innerHTML = ""
  4.         var m = gI(2,20)
  5.         for(i=0;i<m;i++){
  6.                 title.innerHTML += String.fromCodePoint(gI(32,126))
  7.         }
  8. },20)

Final Notes

I'm on the Mozilla Developer wiki! Nothing big, duy, but I might be!

Links

No comments:

Post a Comment