问题
I would like to create something like this in Javascript, and its better if i can do it with Extjs:
showing a small notification icon on a button when the page contains something new, then when the user click this button and open the page, the icon gone.
It's simple HTML5/JavaScript. I update the web page weekly and would like users to notice the updates.
回答1:
This is possible. You have to save a Cookie in your browser once the user click the button. If the Cookie is set, then you can hide the notification.
Here an example:
var myCookie = Ext.util.Cookies.get("YourCookieName");
if(!myCookie){
// show notification
}
And on button click:
Ext.util.Cookies.set("YourCookieName", 1);
来源:https://stackoverflow.com/questions/16728965/notify-user-if-there-is-something-new-in-javascript