My coworker wrote a quick mvc chat application so we can chat about work stuff without leaving our desks.
What are some ways to indicate to each other a new message ha
This nifty function i got reserved should be handy:
It changes the title of the page to alert the user, and returns the function that will stop the interval(i.e. on a window.onmousemove
listener).
function Alert(msg [, ti]) {
// msg = the message, ti= time interval between title changes(default is 1.5s)
var intervalId, oldTitle = document.title;
intervalId = setInterval(function(){
document.title = document.title == msg ? oldTitle : msg;
}, ti ? ti : 1500);
return function() {
if(oldTitle) {
clearInterval(intervalId);
document.title = oldTitle;
oldTitle = intervalId = null;
}
};
}