IE8 does not support querySelectorAll

前端 未结 2 944
挽巷
挽巷 2020-11-29 04:37

I tried to use document.querySelectorAll(), but IE8 throw error, that

Object doesn\'t support this property or method

2条回答
  •  清酒与你
    2020-11-29 05:10

    IE8 only supports querySelectorAll() in standards mode. From MSDN:

    The Selectors API is defined as part of the Selectors API specification and is only available to Web pages displayed in IE8 standards mode.

    Chances are your page doesn't have a proper DOCTYPE declaration; you will need to add one.

提交回复
热议问题