0

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 changed (a new message) when the page is not focused (user in other window/tab)?

thx.

Joel Coehoorn
  • 380,066
  • 110
  • 546
  • 781
WindowsMaker
  • 2,972
  • 7
  • 27
  • 44
  • I doubt you'll get anything better than Facebook Chat has - make a Ding! sound, and change the window title to show a new message has arrived. – thirtydot Mar 29 '11 at 18:45

2 Answers2

0

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.
  }
});
James.Xu
  • 8,101
  • 5
  • 24
  • 36
0

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.

Community
  • 1
  • 1