PDA

View Full Version : variables


chrismiceli
09-26-2002, 07:16 PM
this has a little to do with my last post callled frames but not completely so i put it on a different thread. How can I call a variable or create one that exist in a different frame outside of a function, for example:

var hi = parent.frames[0].document.forms[0].hello.value

everytime I do that it says that parent.frames.... is null or not an object, but if I do the same exact line inside of a function it works just fine, but I need to use make the variable outside of a function, plz help.

chrismiceli
09-26-2002, 07:45 PM
i went to this site and did exactly what they said to at the bottom where it says document.foody.testing() and my browser says objecft doesn't support this property or method.
http://javascriptkit.com/javatutors/twoframes2.shtml

beetle
09-26-2002, 10:25 PM
when you say 'outside a function', I suspect that you have this code in the <HEAD> of the document. If so, trying to access any part of the DOM before the page fully loads will generate these errors.