Bug: Editing any topic gives error in JavaScript console
When in edit mode, any keystroke in the text box will display "Error: window.event has no properties" in the
JavaScript Console if it is open.
Test case
Open the
JavaScript Console. Clear the existing list. Edit any topic. Use any key and see error messages added to the
JavaScript console.
Environment
| TWiki version: |
TWikiRelease01Sep2004 |
| TWiki plugins: |
DefaultPlugin, SpreadSheetPlugin, EditTablePlugin, ActionTrackerPlugin, AgilePlannerPlugin, CommentPlugin, ConditionalPlugin, EmptyPlugin, FormQueryPlugin, InterwikiPlugin, MacrosPlugin, ProjectPlannerPlugin, RenderListPlugin, RollupPlugin, SlideShowPlugin, SmiliesPlugin, SpacedWikiWordPlugin, TWikiDrawPlugin, TablePlugin, XpTrackerPlugin. |
| Server OS: |
RedHat Linux kernel 2.4.20-28.7smp |
| Web server: |
Apache |
| Perl version: |
5.6.1 |
| Client OS: |
MS Windows 2000 SP 4 |
| Web Browser: |
Firefox 1.0 |
--
PeterWeatherdon - 20 Dec 2004
Follow up
Most people don't see this (you would have expected it to be reported before if they did) so it is probably some combination of the many plugins you have installed.
I would suggest you disable all plugins, try again, and if the error still occurs take careful note of the client configuration (browser, version etc) here.
If the error magically disappears, re-enable the plugins one by one until it reappears. Then report the error against the plugin.
--
CrawfordCurrie - 20 Dec 2004
I tried disabling all plugins and the same symptoms occurred.
--
PeterWeatherdon - 31 Dec 2004
My Fix:
Firefox (and I presume all Mozilla family browsers) does not recognize the
window.event.keyCode property in the
onkeydown event handler of the
textarea form element in
edit.tmpl (and the other skinned edit templates). This event handler is trying to override the default action in Internet Explorer of reverting to the original text when you hit the
<Esc> key.
To fix this, replace the existing
onkeydown string (
if(window.event.keyCode==27) return false;) in the
textarea tag (line 93 in my edit.tmpl) with
k=document.all?window.event.keyCode:event.which;return k!=27;
This works for Firefox and IE.
--
PeterWeatherdon - 02 Feb 2005
Fix record