22 August 2011 JavaScript
This blog post is 10 years old! Most likely, its content is outdated. Especially if it's technical.
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
- Previous:
- EmailInput HTML5 friendly for Django 02 August 2011
- Next:
- Reciprocal lesson about gender perspectives 02 September 2011
- Related by category:
- How to "onchange" in ReactJS 21 October 2015 JavaScript
- To then() or to success() in AngularJS 27 November 2014 JavaScript
- How to create-react-app with Docker 17 November 2017 JavaScript
- How to throttle AND debounce an autocomplete input in React 01 March 2018 JavaScript
- Display current React version 07 January 2018 JavaScript
- Related by keyword:
- TornadoGists.org - launched and ready! 06 April 2011
- The importance of the TITLE attribute 23 April 2008