window.focus(), self.focus() not working in firefox

Posted by Nisanth on Stack Overflow See other posts from Stack Overflow or by Nisanth
Published on 2010-03-28T14:52:48Z Indexed on 2010/03/28 15:33 UTC
Read the original article Hit count: 734

Filed under:
|
|

Hi all i am developing a chat application ... i have multiple chat windows ... i want to know which windw contain new message ... i have the following code ..

function getCount()
{
    $.ajax({
       type: "POST",
       url: baseUrl + '/Chat/count',
       data: "chat_id=" + document.ajax.chat_id.value,
       success: function(msg){
                if(msg == 'new1') {
                    self.focus();
                                            //window.focus();

                }
            }
    });
}

If an operator attending both chat....

for example the url is like http://localhost/nisanth/admin/Chat/index/chatId/15 http://localhost/nisanth/admin/Chat/index/chatId/16

http://localhost/nisanth/user/Chat/index/chatId/15 http://localhost/nisanth/user/Chat/index/chatId/16

if the user 16 enter a message i need focus

http://localhost/nisanth/admin/Chat/index/chatId/16

This code is work fine with IE but not in firefox...please give me a solution... the above code is in the same html

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery