Opened 8 months ago

Closed 7 months ago

#22053 closed defect (bug) (fixed)

IE 7/8 shows a JavaScript error in editor_js()

Reported by: SergeyBiryukov Owned by: azaozz
Priority: normal Milestone: 3.5
Component: Editor Version: 3.5
Severity: normal Keywords: has-patch needs-testing
Cc:

Description

Message: Object doesn't support this property or method 
Line: 909
Char: 5
Code: 0
URI: http://trunk.wordpress/wp-admin/edit-comments.php

The line that causes this is:

el = document.getElementsByClassName('wp-editor-wrap');

Attachments (4)

patch-22053.patch (691 bytes) - added by dannydehaan 8 months ago.
Patch for ticket 22053
22053-2.diff (693 bytes) - added by CoenJacobs 8 months ago.
Fixed dannydehaan's patch, getElementByClassName should be getElementsByClassName
22053.3.diff (681 bytes) - added by SergeyBiryukov 8 months ago.
With proper formatting
22053.4.diff (753 bytes) - added by dannydehaan 8 months ago.

Download all attachments as: .zip

Change History (13)

Introduced in [22007].

To reproduce, just visit the Dashboard or Comments screen.

Patch for ticket 22053

This is because getElementsByClassName is only available in HTML5. IE8 only partially supports HTML5, getElementsByClassName is not supported as you can see here: http://caniuse.com/#search=getelementsbyclassname. I've made a patch for this. When getElementsByClassName is available, the script will use that, otherwise it will use the fallback document.querySelectorAll('.wp-editor-wrap');

Last edited 8 months ago by dannydehaan (previous) (diff)
  • Keywords has-patch added

Fixed dannydehaan's patch, getElementByClassName should be getElementsByClassName

  • Keywords needs-testing added

With proper formatting

  • Summary changed from IE 8 shows a JavaScript error in editor_js() to IE 7/8 shows a JavaScript error in editor_js()

22053-2.diff fixes the error in IE 8, but not in IE 7, which doesn't support querySelectorAll(): http://caniuse.com/queryselector

I also see (probably unrelated) "Error: 153 Unspecified Error" without any details on every admin screen in IE 7. Not sure how to debug that. Perhaps there's an issue with my standalone IE 7 install, however I don't remember seeing that in 3.4.

I've made a jQuery solution so it will work in all browsers, couldn't find anything with better performance that could fix this issue. What i do see is that the editor becomes visible after clicking HTML, then back to visual, so it's not directly visible, i don't know if this should be the behaviour?

About your other "Error", i can't see it in Internet Explorer 7 or 8. I'm using a virtual machine with Windows XP and Utilu IE Collection, so it could be that.

  • Owner set to azaozz
  • Status changed from new to reviewing
  • Resolution set to fixed
  • Status changed from reviewing to closed

This was fixed in [22251]. Sorry, forgot to close this ticket with the commit.

Note: See TracTickets for help on using tickets.