While testing on IE7 I noticed some form submits causing javascript errors(message was something like, "Object doesn't support this property"). The reason the error was caused in IE(not Firefox) was because of the way "beforeunload" events are being added on certain pages. The pages are:
- ./forum/skins/default/templates/ask.html
- ./forum/skins/default/templates/answer_edit.html
- ./forum/skins/default/templates/question_edit.html
- ./forum/skins/default/templates/question.html
The "addEventListener" and "removeEventListener" methods are used but IE7 doesn't work well for these methods.
To solve, I just modified the javascript code to do this:
if (window.detachEvent) {
window.detachEvent('beforeunload', beforeUnload);
} else if (window.removeEventListener) {
window.removeEventListener('beforeunload', beforeUnload, true);
} else {
document.removeEventListener('beforeunload', beforeUnload, true);
}
if (window.attachEvent) {
window.attachEvent('beforeunload', beforeUnload, true);
} else if (window.addEventListener) {
window.addEventListener('beforeunload', beforeUnload, true);
} else {
document.addEventListener('beforeunload', beforeUnload, true);
}
I just wanted to find out if anyone noticed this issue and fixed in a similar way. Here is my SVN info:
asked
24 Aug '10, 10:13
memdude
1●2●2
accept rate:
0%
I have the same issue with OSQA r583 and IE 8. IE 6 works fine amazingly enough.
This appears to be a known bug: http://jira.osqa.net/browse/OSQA-439