Heylo guys,
i have a page that gets new content using AJAX/ASP (a shoutbox-like type of thing). i was wondering if its possible to create a popup window to notify that the page has开发者_StackOverflow中文版 changed (a new message) when the page is not focused (user in other window/tab)?
thx.
You can take a look at this page and see if it works for you. It has code for doing desktop notifications in Chrome. I don't think there is a cross browser way of doing it.
edit: I got the above link from this stackoverflow answer.
If i understand it correctly, the page is changed by your code right? then you can popup the window in the ajax callback function: http://api.jquery.com/jQuery.ajax/
$.ajax({
url: "test.html",
context: document.body,
success: function(){
// popup the window here.
}
});
精彩评论