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.