开发者

AJAX notification when page has changed

开发者 https://www.devze.com 2023-02-20 18:57 出处:网络
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开发者_StackOverf

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.
  }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消