What is the correct way to detect Opera using jQuery?

前端 未结 9 1689
梦毁少年i
梦毁少年i 2021-02-19 04:52

Amazon.com recently updated their javascript, and it\'s causing problems with some Opera browsers.

Their browser detection code looks like so, but it\'s faulty:

相关标签:
9条回答
  • 2021-02-19 05:50

    The main reason why Amazon fails on Opera is because the send different code from the server side already... If you visit the same page with Firefox and then save that page and reopen it in Opera it works fine...

    But they promised to fix that sometime in January...

    0 讨论(0)
  • 2021-02-19 05:52

    A very simple way from Opera themselves:

    if (window.opera) {
        //this browser is Opera
    }
    

    Source: http://my.opera.com/community/openweb/idopera/

    0 讨论(0)
  • 2021-02-19 05:56

    I don't know for sure ( i never really check for opera anyway) but if the built-in jQuery functionality doesn't detect opera, may be a bug with the jQuery which needs to be fixed. I would suspect if that's the case, it should get resolved fairly quickly.

    0 讨论(0)
提交回复
热议问题