转自:http://pushingtheweb.com/2010/10/reaching-out-of-the-browser-sandbox-using-jquery-title-alert/
Most websites that we develop at ESN
are
social websites with real-time features. Features that are in real-time
on these websites might be contact lists with chat features,
counter-strike game lobbies, social activity feeds, and so on. Having
these features in real-time really enhances the over all functionality
of the websites, especially together with some ways of making users
aware of the updates, like animations and toasters.
These websites – as well as many others on the net like Facebook,
Twitter, Gmail, Last.fm (the list goes on forever) – are more and more
taking the role that was previously hold by normal applications like
Thunderbird, Emacs, Skype, etc. When using such web application, it’s
normal user behavior to multitask between different web pages and
programs, just like one would do using a normal application, like Skype.
However, OS level programs have ways to alert the user when certain
events occur (i.e. someone sends you a message), that web application is
some what lacking, because they live in the browser sandbox. This is a
problem, because the usefulness of having a user-to-user chat in
real-time, decreases a great deal, if one has to manually go and check
for new messages while having another website, or another program,
focused. One solution to this is to show notification messages in the
browser’s title bar.
That’s why I wrote jQuery Title Alert
about a year ago. It’s a small jQuery
plugin for displaying a flashing notification message in the browser’s
title bar. It supports setting different intervals and timings, that
defines the appearance of the notification, as well as options for
stopping the title notification when the browser get focus.
Hopefully someone will find the plugin very useful as a complement to a website that uses a real-time service
like BeaconPush
.
Try it!
Here is an example on how to use it:
(See the documentation
for all available options)
$.titleAlert("New chat message!", {
stopOnFocus:true,
duration:60000,
interval:500
});
Get it!
Go ahead and grab it in my original blog post
, or at the project GitHub page
. And feel free to fork it as much as you want!
分享到:
相关推荐
Printed vs PDF Versions of the Book...............................................................ix 1. Scope of this Volume...............................................................................
23. The five layers in the Internet protocol stack are – from top to bottom – the application layer, the transport layer, the network layer, the link layer, and the physical layer. The principal ...
Web technology has become the foundation for all sorts of critical networked applications and far-reaching methods of data exchange, and beneath it all is a fundamental protocol: HyperText Transfer ...
Emergence of Data Science placed knowledge discovery, machine learning, and data mining in multidimensional data, into the forefront of a wide range of current research, and application activities in ...
1.2.3.6.2 Usage of carriers in the middle of the bandwidth for PBCH and synchronization signals.................................................................29 1.2.3.6.3 Deployment Scenarios..........
1.2.3.6.2 Usage of carriers in the middle of the bandwidth for PBCH and synchronization signals.................................................................29 1.2.3.6.3 Deployment Scenarios..........
- **《The Computational Brain》**:该章节由Patricia S. Churchland和Terrence J. Sejnowski编写,重点介绍了大脑如何通过计算处理信息。它不仅涵盖了基本的认知过程,还深入探讨了神经网络如何支持高级认知功能。...
partial fulfillment of the requirements for the Master of Science degree in the Department of Geography. This thesis has been approved and accepted by: Date Committee in Charge: W. Andrew Marcus, ...
1.2.3.6.2 Usage of carriers in the middle of the bandwidth for PBCH and synchronization signals.................................................................29 1.2.3.6.3 Deployment Scenarios..........
If that happened, a tsunami-like wall of water would rip through the Zambezi valley, reaching the Mozambique border within eight hours. The torrent would overwhelm Mozambique’s Cahora Bassa Dam and ...
With robotic systems reaching considerable maturity in basic self-localization and environment mapping, new research avenues open up pushing for interaction of a robot with its surroundings for added ...
Using an ensemble of batch-normalized networks, we improve upon the best published result on ImageNet classification: reaching 4.9% top-5 validation error (and 4.8% test error), exceeding the ...
The syntax of the file is extremely simple. Whitespace and lines ; beginning with a semicolon are silently ignored (as you probably guessed). ; Section headers (e.g. [Foo]) are also silently ignored,...
They are stored in the client's browser and sent back to the server in subsequent requests, allowing the server to remember user preferences or session information. Question 1.4 highlights the three...
Over the years, we have maintained this emphasis on reaching out to students to explain complex concepts in a practical, approachable manner. This book has been successful through ten editions ...