0

Can someone please advise me why the following code does not work in Internet Explorer 9

document.addEventListener("DOMContentLoaded", function() {
  // DEBUG
  if (JB_Shopping_Basket.Options.debug)   {
    console.log('Document loaded');}

  JB_Shopping_Basket.Runtime.basket = new JB_Shopping_Basket.Objects.Basket
  JB_Shopping_Basket.Functions.refreshProductsTable(JB_Shopping_Basket.Runtime.productsList);});

I'm getting an error that tells me my Basket Object doesn't support property or method 'addEventListener'. It works perfectly it all other browsers but not IE. Any pointers please?

user3414871
  • 99
  • 1
  • 1
  • 8
  • Currently reading the article from http://stackoverflow.com/questions/9769868/addeventlistener-not-working-in-ie8?rq=1 – user3414871 Jan 29 '15 at 18:24
  • Do you have a proper HTML5 DTD? – Teemu Jan 29 '15 at 18:26
  • It says that Basket Object doesn't support `addEventListener`? But you are using `document.addEventListener`, not `JB_Shopping_Basket.addEventListener`. – Oriol Jan 29 '15 at 18:29
  • According to MDN, it should work with `document.addEventListener`. As Teemu said, ` ` might be important. See also: https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded – Lea Rosema Jan 29 '15 at 19:53

0 Answers0