search

Home  >  Q&A  >  body text

Js现代事件处理方式中,怎么针对老版本的浏览器做兼容性处理?

城堡下的诡洞城堡下的诡洞2929 days ago1133

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:12:41

    In the modern event processing method of JS, how to deal with compatibility for older versions of browsers? -PHP Chinese website Q&A-In the modern event processing method of JS, how to deal with compatibility for old versions of browsers? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-20 15:11:06

    If(document.addEventListener){

    [object].addEventListener(“事件名称”,函数名,true/false)     //DOM

    }else if(document.attachEvent){

    [object].aattachEvent(“事件名称”,函数名,true/false)     //   IE

    }


    reply
    1
  • Cancelreply