久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

window.focus(), self.focus() 在 Firefox 中不起作用

window.focus(), self.focus() not working in firefox(window.focus(), self.focus() 在 Firefox 中不起作用)
本文介紹了window.focus(), self.focus() 在 Firefox 中不起作用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

大家好,我正在開發(fā)一個聊天應(yīng)用程序...我有多個聊天窗口...我想知道哪個窗口包含新消息...我有以下代碼..

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....

例如,網(wǎng)址就像http://localhost/nisanth/admin/Chat/index/chatId/15http://localhost/nisanth/admin/Chat/index/chatId/16

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

如果 user 16 輸入我需要關(guān)注的消息

if the user 16 enter a message i need focus

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

這段代碼在 IE 下可以正常工作,但在 firefox 下不行...請給我一個解決方案...上面的代碼在同一個 html 中

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

推薦答案

如果設(shè)置了安全選項,F(xiàn)irefox 只會服從引發(fā)窗口的請求,并且默認(rèn)情況下未設(shè)置.據(jù)我所知,Chrome 根本不會關(guān)注 focus() 請求.Safari 確實服從 focus() 請求.

Firefox will only obey requests to raise a window if a security option is set, and it's not set by default. Chrome won't pay attention to focus() requests at all, as far as I can tell. Safari does obey focus() request.

特定的 Firefox 設(shè)置在工具"->選項"(Linux 上的編輯->首選項",可能是 MacOS)對話框中.有一個內(nèi)容"選項卡,其中有一個用于啟用 Javascript 的復(fù)選框.與 that 一起是一個高級"按鈕,它會打開 另一個 對話框,其中可以找到一個復(fù)選框以允許(或禁止)通過頁面代碼升高和降低窗口.

The specific Firefox setting is in the "Tools" -> "Options" ("Edit -> Preferences" on Linux, maybe MacOS) dialog. There's a "Content" tab, and in that there's a checkbox for enabling Javascript. Along with that is an "Advanced" button that brings up another dialog, wherein one finds a checkbox to allow (or disallow) the raising and lowering of windows by page code.

這是一個測試頁面:http://gutfullofbeer.net/focus1.html 并且您應(yīng)該能夠看到當(dāng)頁面調(diào)用 window.focus() 時 Firefox 彈出一個窗口.您必須設(shè)置瀏覽器,以便新窗口(使用 window.open() 創(chuàng)建)在新的單獨窗口而不是選項卡中打開,或者您可以撕下打開時的第二頁.

edit: Here is a test page: http://gutfullofbeer.net/focus1.html and you should be able to see that Firefox will raise a window when the page calls window.focus(). You must either have the browser set up so that new windows (created with window.open()) open up in a new separate window instead of a tab, or else you can tear off the tab of the secondary page when it opens.

這篇關(guān)于window.focus(), self.focus() 在 Firefox 中不起作用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

jQuery/JavaScript Library for avatar creation?(用于創(chuàng)建頭像的 jQuery/JavaScript 庫?)
How to do following mask input problem?(如何做以下掩碼輸入問題?)
Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 設(shè)置值/標(biāo)簽的問題)
how to unit-test private methods in jquery plugins?(如何對 jquery 插件中的私有方法進(jìn)行單元測試?)
stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 為垂直滾動網(wǎng)站配置偏移量/對齊元素?)
jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽輸入插件.當(dāng)文本框獲得焦點時選擇所有內(nèi)容)
主站蜘蛛池模板: 亚洲综合色视频在线观看 | 欧美国产精品久久久 | 国产精品2 | 欧美日韩成人在线观看 | 精品www| 亚洲人成人一区二区在线观看 | 欧美精品黄 | 日韩视频中文字幕 | 国产人成精品一区二区三 | 男女搞网站 | 9久9久9久女女女九九九一九 | 午夜影院在线观看免费 | 亚洲精品视频免费 | 天堂网中文字幕在线观看 | 日韩av一区二区在线观看 | 精精国产视频 | 亚洲美女一区 | 久久免费精品视频 | 国产精品爱久久久久久久 | 一级欧美视频 | 免费看的av | 日韩精品 电影一区 亚洲 | 午夜成人在线视频 | 国产精品美女一区二区三区 | 日本国产一区二区 | 欧美视频一区二区三区 | 久久精品国产精品青草 | 视频国产一区 | 国产一区在线免费观看视频 | 狠狠夜夜 | 日韩精品一区二区三区高清免费 | 亚洲成色777777在线观看影院 | 黄免费观看 | 国产精品亚洲第一 | 欧美一级免费 | 欧美三级在线 | 中文二区| 最新高清无码专区 | 亚洲美女一区二区三区 | 久久人体 | 欧美精品一区三区 |