How to change browser focus from one tab to another

前端 未结 6 639
暗喜
暗喜 2020-11-28 14:01

I have a JavaScript chat client running in one browser tab (call it tab A). Now when a message arrives the user might be on another browser tab (call it tab B). I\'m looking

6条回答
  •  感动是毒
    2020-11-28 14:55

    this worked for me on form submit to reopen the target window.. so it will call window.open on the same target (or new if changed) and then continue to submit the form.

            var open_target = function (form){
                var windowName = jQuery(form).attr('target');
                window.open("", windowName );
                return true;
            };
        

提交回复
热议问题