Currently:
JavaScript debugging tips:
CC,
TW
- Use Firefox with the 'Venkman' debugger to catch errors or IE with Microsoft Script Debugger installed (available free for registered owners of MS products available from here
)
- IE debugging is a lot easier if you have Visual Studio
- Mozilla and IE show different errors, because their intepretation of the DOM is different. You must test on both!
- If you see an error, please try to describe a testcase for regenerating it, and give as much information as possible! JavaScript errors can can a long time to track down.
On the error in "Edit settings": This one is a mystery to me. The template contains an element with
name='text'
(i.e., the textarea) so the
document.main.text.focus()
should succeed. I am really puzzled by this one. --
TW
however, the
settings.pattern.tmpl
doesn't contain a form named
main
; it's called
saveSettings
.
so, there are three choices that i know of:
- change the name from
saveSettings
to main
.
- change
document.main.text.focus()
to document.getElementById( 'text' ).focus()
- actually, even safer would be:
var text = document.getElementById( 'text' ); if ( text ) { text.focus() }
- change all of the scripts in
settings.tmpl
from document.main...
to document.saveSettings...
--WN
Fixed
- Edit settings: in
initForm(): document.main.text.focus();
'document.main.text' is null or not an object
based on
WN's suggestion. SVN 6599 --
TW
Removed the following, as I cannot see it anywhere but in bugs web. --
TW
- Edit: in
initForm(): document.main.text.focus();
Cannot change focus. May only be in bugs web
- No, I've seen it in other installations, in webs where the textarea is enabled CC
- This shows up whenever the textarea is not present. You can then not set focus to that item. In the bugs web, for example, the text area is hidden using JavaScript which causes this error. It would be much better to use action=editform to hide the text which uses a template that does not involve setting focus.
Someone has added a "focus" macro to switch this off. I don't get any errors now, so I'm closing this.
CC
Now these have been fixed:
- Edit form (using action=form):
Error: 'classes' is null or not an object
Refers to function getClassList
- Edit newly created XXXXX topic:
Error: 'classes' is null or not an object
Refers to function getClassList
typing in the topic textarea produces
Error: window.event has no properties
SVN:6665
--
WN
Error: element has no properties
Source File: http://develop.twiki.org/~develop/cgi-bin/edit/Bugs/ItemXXXXXXXXXX?templatetopic=Bugs.HideTextarea&formtemplate=Bugs.ItemTemplate&_T=0501092906&action=form
Line: 96
click on this link to produce the error:
http://develop.twiki.org/~develop/cgi-bin/edit/Bugs/ItemXXXXXXXXXX?templatetopic=Bugs.HideTextarea&formtemplate=Bugs.ItemTemplate&_T=0501092906&action=form
WN
SVN 6679
CC
Error identified by
WN right above is still happening. --
TW
Was a different error, and was on IE only. Fixed by putting a try{} block around the focus-setting call.
SVN 6704
CC
On logon page,
initPag()
causes an error. --
TW
Mysteriously disappeared... --
TW