This is a piece of Javascript code I use on "Kwissle" to make the document title change temporarily. Other people might find it useful too.

Code looks like this:


var Title = (function() {
 var current_title = document.title
   , timer;

 return {
    showTemporarily: function (msg, msec) {
      msec = typeof(msec) !== 'undefined' ? msec : 3000;
      if (msec < 100) msec *= 1000;
      if (timer) {
        clearTimeout(timer);
      }
      document.title = msg;
      timer = setTimeout(function() {
        document.title = current_title;
      }, msec);
    }
 }
})();

Demo here

Comments

Your email will never ever be published.

Previous:
EmailInput HTML5 friendly for Django August 2, 2011 Django
Next:
Reciprocal lesson about gender perspectives September 2, 2011 Wondering
Related by category:
You don't need a context or state manager for TanStack Query in scattered React components January 2, 2026 JavaScript
Always run biome migrate after upgrading biome August 16, 2025 JavaScript
Video to Screenshots app June 21, 2025 JavaScript
An ideal pattern to combine React Router with TanStack Query November 18, 2024 JavaScript
Related by keyword:
Search GitHub issues by title, only May 31, 2024 GitHub
The importance of the TITLE attribute April 23, 2008 Web development
TornadoGists.org - launched and ready! April 6, 2011 Python, Tornado