[thelist] IE JavaScript issues?

Kristian Rink kristian at zimmer428.net
Fri Nov 17 01:35:52 CST 2006

Hi all;

and, at first, thanks loads for your hints so far. Things I've learned
the last few hours:

- The "onmouseover" issue for the <a> tag is sort of "resolved", as it
doesn't relate to the event itself. Case sensitivity also doesn't matter
here (the lowercase version works, the camelcase one doesn't). When
attaching the JavaScript debugger, I can see the MSIE complains about

	hint = document.getElementById("hint");

... why on earth? Testbed environment so far is MSIE 6.0, and according
to the manual I use (selfhtml ...), getElementById() should be perfect
for post-5.5 IE's. Or am I wrong on that?

- However, replacing "document.getElementById()" by
"window.document.all.<id>" works. Thus, the most straightforward idea is
to build a getElement(name) wrapper in order to ease accessing elements
throughout the code. Did something like

function getElement(name)

	if (window.document.all)
		return eval("window.document.all."+name);

which also ends up in "Object does not support method or property". :/

- I am not yet sure about the dynamically added fields. Situation is
like this: On the "first" file input which is initially there (lowercase
attribute, the same JS function), the "onchange" works and (as desired)
adds a new one. On the first dynamically added one, it does not work. No
matter whether I use CamelCase or all lower case. Does that make sense
somehow? I feel rather clueless here... :(

> -. using inline event handlers are just as bad as using inline CSS; use
> JavaScript
> unobtrusively instead [1]
> [1] http://onlinetools.org/articles/unobtrusivejavascript/

I will have a look at this, thanks for the hint. However, for what I
see, my event handlers aren't inline (as they are placed in an external
file); but somehow I have to attach the event handler to the very
element, haven't I?

Anyhow, thanks loads for your help and have a calm friday...

More information about the thelist mailing list