Ruby's Louvre

每天学习一点点算法

导航

判定是否支持DOMFocusIn事件

      var supportDOMFocusIn = false
      try{
        document.addEventListener("DOMFocusIn",function(){
          supportDOMFocusIn = true
        },false);
        var event = document.createEvent("UIEvent");
        event.initEvent("DOMFocusIn", false, true );
        document.dispatchEvent(event)
      }catch(e){}
      alert( supportDOMFocusIn)

posted on 2011-05-16 11:37  司徒正美  阅读(1367)  评论(0编辑  收藏  举报