Viewing a single comment thread. View all comments

twovests wrote

<script>
  document.addEventListener
  (
    // The webpage "document" listens for an event titled "DOMContentLoaded".
    "DOMContentLoaded",
    // When this happens, it runs this "anonymous function"
    // It takes no parameters, `()`, and runs everything inside the { }
    () => {
      // An array of splash text,
      splashes = [
        "born 2 post",
        "Now with 100% more post!",
        "Where's The Dog Honey?",
        "I love you thiiiiiiis much",
        "﷽﷽﷽﷽",
      ];
      // And now, inside the webpage "document", find our "splash", and set its text.
      // What do we set it to? splashes[ some_random_index ]
      document.getElementById("splash").textContent = splashes[
         Math.floor(Math.random() * splashes.length)
      ];
      // Most programming languages have something like "Math.randrange(0, splashes.length)"
      // But JavaScript hates you
    }
  );
</script>
<p id="splash"></p>

behold

1