0
1

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's gravatar image

memdude
122
accept rate: 0%

closed 30 Apr '11, 09:11

Andrew_S's gravatar image

Andrew_S ♦
5.6k45674

I have the same issue with OSQA r583 and IE 8. IE 6 works fine amazingly enough.

(04 Sep '10, 18:02) Gerald Combs

This appears to be a known bug: http://jira.osqa.net/browse/OSQA-439

(05 Sep '10, 16:52) Gerald Combs

The question has been closed for the following reason "Problem now fixed in trunk" by Andrew_S 30 Apr '11, 09:11

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×14
×3

Asked: 24 Aug '10, 10:13

Seen: 408 times

Last updated: 30 Apr '11, 09:11

powered by OSQA