admin管理员组

文章数量:1389973

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 /

Thanks in advance.

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.

Share Improve this question asked Jun 8, 2012 at 8:59 zigojackozigojacko 2,07312 gold badges46 silver badges82 bronze badges 6
  • probably trying to hide a element or change display state of the element that is not existing on your DOM so don't look for prototype errors but your own code – Anton S Commented Jun 8, 2012 at 10:48
  • hmm, okay. not my code as it's a 3rd party extension. And was working, in fact - here it is on dev site working in IE9 (004sm.clubnetdev.) - exactly the same code... – zigojacko Commented Jun 8, 2012 at 12:17
  • you do understand that it is not exactly the same if it is working on one and not in the other :) – Anton S Commented Jun 8, 2012 at 12:20
  • I appreciate what you're saying but the code is 100% identical for this particular extension between the two sites. – zigojacko Commented Jun 8, 2012 at 12:54
  • The number one peice of advice i can give you, When yor code doesn't work its your fault not the code. You should only cry 'bug' when you've exhuasted every other possibility. – gbtimmon Commented Jun 11, 2012 at 19:02
 |  Show 1 more ment

2 Answers 2

Reset to default 2

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.

I had the same error in one of my apps. To fix it I changed the X-UA-COMPATIBLE to:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">

本文标签: javascriptIE9 JS Unable to get value of the property 39display39 object is null or undefinedStack Overflow