如何在按下esc键时关闭我的ajaxpopup [英] how can i close my ajaxpopup on pressing esc key

查看:94
本文介绍了如何在按下esc键时关闭我的ajaxpopup的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有AJAX模式弹出窗口。我希望按ESC键关闭它。



 <   script     type   =  text / javascript >  
document .onkeyup = Esc;
函数Esc(){
var KeyID = event.keyCode;
if(KeyID == 27){
if($ find(mpForLeave)){
$ find(mpForLeave)。hide();
}

}
}





所以我写了这个脚本。但是我无法理解我应该在哪里调用它?

请帮忙。

解决方案

find(mpForLeave)){

找到( mpForLeave)隐藏();
}

}
}





所以我写了这个脚本。但我无法理解我应该在哪里打电话给它?

请帮助。


在您的页面中使用如下: -



 <   script    类型  =  text / javascript >  


Hi,

I have AJAX modal popup. I want it to be closed on pressing ESC key.

<script type="text/javascript">
        document.onkeyup = Esc;
        function Esc() {
            var KeyID = event.keyCode;
            if (KeyID == 27) {
                if ($find("mpForLeave")) {
                    $find("mpForLeave").hide();
                }
                
            }
        }



So I have written this script. But I am unable to understand where I should call this?
Please help.

解决方案

find("mpForLeave")) {


find("mpForLeave").hide(); } } }



So I have written this script. But I am unable to understand where I should call this?
Please help.


Use below in your page like:-

<script type="text/javascript">


这篇关于如何在按下esc键时关闭我的ajaxpopup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆