Search code examples
javascriptmagentoprototypejsinternet-explorer-9

IE9 JS Unable to get value of the property 'display': object is null or undefined


Recently launched a Magento store which features an image slider on the homepage. Works perfectly in Firefox, Chrome etc etc but as usual, IE9 is causing issues - the strange thing is, this was working in IE so not sure what has caused it to stop functioning.

As it stands, in IE9, it cannot detect the range of images in the slider (only displays the first in the sequence) and subsequently doesn't slide anywhere.

In IE9 developer mode, errors are:-

=======#

SCRIPT438: Object doesn't support property or method 'dispatchEvent'
prototype.js, line 5734 character 7

Code snippet:

5733 if (document.createEvent)
5734   element.dispatchEvent(event);
5735 else
5736   element.fireEvent(event.eventType, event);

=======#

And...

=======#

SCRIPT5007: Unable to get value of the property 'display': object is null or undefined
prototype.js, line 2542 character 5

Code snippet:

2538 else if (Prototype.Browser.IE) {
2539   Element.Methods.getStyle = function(element, style) {
2540     element = $(element);
2541     style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
2542     var value = element.style[style];
2543     if (!value && element.currentStyle) value = element.currentStyle[style];

=======#

In Magento (1.6.2.0), we're using latest version of prototype.js (1.7).

We've also added IE standards mode to the head...

<!-- Enable IE8 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=8" >

Similar errors do appear in Firefox and Chrome but they don't appear to affect the functionality.

Please could anyone be as kind to take a look and advise of where the problem could be as I'm unsure what to fix. Site in question is http://www.showermania.co.uk/

Thanks in advance.


Solution

  • Resolved the issue in the end.

    Reset Magento's session cookie management settings (it's probably also worth clearing cache, reindexing all and clearing any sessions and locks whilst your at it). It solved my issue (weirdly) so if anyone experiences something similar, it's probably worth a shot.