[thelist] simple but baffling JS problem...

Ben Henick persist1 at io.com
Sun Feb 4 22:48:37 CST 2001

On Sun, 4 Feb 2001, John Corry wrote:

> When you click the checkbox, an error is generated that says 'propName is
> null or not an object'. But, as far as I can tell...it IS TOO an object!
> I suspect this is because of how I try to access the value...from one framed
> page, up to parent, and back down into the other framed page.

When I was donig something similar on a project a couple of years ago, it
became apparent to me (under a great deal of time pressure) that if I
started at the top of the hierarchy and worked my way down, I'd have a
solution that would work cross-platform:

var x = window.top.frames[1].document.forms[0].elements[8].value;

...To provide an example.  If you want to make a really ironclad
reference (albeit one that will consume more system resources) make sure
that strings (e.g. text inputs and textarea content) are copied to
explicitly-constructed String objects.

For those who are wondering:  no, I don't like writing my code this
way.  But I like wild-goose-chases even less.

Ben Henick
Web Author At-Large
persist1 at io.com

"Are you pondering what I'm pondering, Pinky?"
"I think so, Brain, but... (snort) no, no, it's too stupid."
"We will disguise ourselves as a cow."
"Oh!" (giggles) "That was it exactly!"

More information about the thelist mailing list