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: |
|
Owned by: |
|
|---|---|---|---|
| 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)
Change History (13)
comment:1
SergeyBiryukov — 8 months ago
comment:2
SergeyBiryukov — 8 months ago
To reproduce, just visit the Dashboard or Comments screen.
comment:3
dannydehaan — 8 months ago
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');
comment:4
SergeyBiryukov — 8 months ago
- Keywords has-patch added
CoenJacobs — 8 months ago
Fixed dannydehaan's patch, getElementByClassName should be getElementsByClassName
comment:5
dannydehaan — 8 months ago
- Keywords needs-testing added
comment:6
SergeyBiryukov — 8 months ago
- 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.
dannydehaan — 8 months ago
comment:7
dannydehaan — 8 months ago
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.
comment:8
SergeyBiryukov — 7 months ago
- Owner set to azaozz
- Status changed from new to reviewing

Introduced in [22007].