Knock Knock! Browser Check

A lighthearted way to handle browser compatibility. This script checks if the user's browser is modern enough to handle your site's features, rewarding compliant users with a series of joke alerts.

Compatibility Joke Trigger

Copy the Script

<script>
  function runJoke() {
    var ver = parseInt(navigator.appVersion);
    if (ver >= 4) {
      alert("Knock, knock!");
      alert("Who's there?");
      alert("Java.");
      alert("Java who?");
      alert("Java nice day, because your browser is up to date!");
    } else {
      alert("Your browser is a bit old. You should update to see the joke!");
    }
  }
</script>