Zepto fallback to jQuery

前端 未结 10 1642
孤独总比滥情好
孤独总比滥情好 2020-12-23 18:53

I\'m using ZeptoJS for my web app, but I\'d like to fall back to jQuery if the browser doesn\'t support Zepto. Since IE is the only major browser not supported at the moment

10条回答
  •  孤独总比滥情好
    2020-12-23 19:16

    As Zepto Documentation said, if you need to detect Internet Explorer you can use this code:

      if ('__proto__' in {}) {
        // IS NOT IE
    
      } else {
        // IS IE
    
      }
    

    Zepto use it to fall back on jQuery, but I have use it as browser detection too.

提交回复
热议问题