[thelist] a plea for assistance...

Andrew Clover and-evolt at doxdesk.com
Thu Nov 6 09:34:54 CST 2003


"jsWalter" <jsWalter at torres.ws> wrote:

> I've brought this up here before, it's my Text/TextArea status bar
> script/css.

A new one to me. :-)

> Nothing is visible in Konqueror.

Ah yes. Debugging in Konq isn't entirely fun, what with the lack of
error messages, and the blocking of javascript: URLs in the address bar.

Your immediate problem appears to be:

  if($_objForm.nodeName == "FORM")

In Konqueror, the nodeName is 'form' in lower case. The same goes for
'TEXTAREA' and so on. This is as if it is in XML-parsing mode, which is
odd since it is not enforcing case-sensitivity in CSS, nor failing to
render the page as HTML due to the lack of XHTML namespace (declared
or used in createElement).

Probably best to upper-case the nodeName before testing, and go back
to XHTML 1.0 (since technically 1.1 shouldn't be served as text/html or
rely on non-XML-parsing stuff).

You should probably be aware that (a) added arbitrary attributes to
elements isn't necessarily guaranteed to work, (b) innerHTML and
offsetWidth aren't standard, (c) settings a style.width property to an
integer value is bad, and (c) all those dollar variables are pretty
weird. But you likely knew that. ;-)

Finally, I can't work out what this is doing:

  function setBar ( evt )
  {
    // local var evt refers to current event
    // evt could also be a passed in Form Object
    evt = (evt) ? evt : ((event) ? event : null);
    // If evt is a Form Object, redefine it.
    // If evt is an EVENT, then find out which Object called this
    var $_objFormElement = evt.target ? evt.target : (evt.srcElement ? evt.srcElement : evt);


If setBar is being called by the event.js module (as it seems to be),
then you don't need to do all this: the target is passed as the first
parameter. You can just say:

  function setBar($_objFormElement, eventType)
  { ...

You also don't need to set setBar to be a method of the element object,
it works fine as a normal standalone function.

HTH!

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/


More information about the thelist mailing list