How to close a window using jQuery

前端 未结 5 1649
隐瞒了意图╮
隐瞒了意图╮ 2020-12-15 03:29

How to close a window using jQuery for all browser compatibility?



        
5条回答
  •  萌比男神i
    2020-12-15 04:13

    $(element).click(function(){
        window.close();
    });
    

    Note: you can not close any window that you didn't opened with window.open. Directly invoking window.close() will ask user with a dialogue box.

提交回复
热议问题