posted 11 years ago
Hi All,
I am currently trying to convert some horrendous IE 7-specific JavaScript DOM codes into W3C-compliant DOM JavaScripts... Unfortunately, I've been hitting a lot of brickwalls where I try to translate an IE 7-specific JS-DOM property to a W3C compliant JS-DOM property - only to get the dreaded "undefined" error message in my Safari Error Console.
Take for example the following:
I've been wading through a lot of IE JS-DOM codes that end up giving me what Safari recognizes as HTMLFormElement node object. In Safari's Debug Mode, I see the HTMLFormElement node object is full of blank HTMLInputElement node objects. So I thought I could just do a HTMLFormElement.item(0), HTMLFormElement.item(1), etc... to select each of these HTMLInputElement node objects even though they are shown as blank in the debug window...
However - as soon as my JS hits HTMLFormElement.item(0) - the console says "undefined". Which doesn't make sense - cause HTMLFormElement.length = 100 (so there's definitely child-nodes in there.) At this point, I'm getting kind of lost on what to do, cause Safari is blatantly telling me HTMLFormElement exists - with length of 100, but I can't access even the 0-index item of it...