[thelist] Two Javascript problems

Warden, Matt mwarden at odyssey-design.com
Sun Sep 17 17:57:54 CDT 2000


Let's say that the first page has this script:


<script language="JavaScript" type="text/javascript">

var sMyName = "Matt Warden";

function getMyName()
{
    return sMyName;
}

</script>


------------------------------------

then, you have this on the page in the opened window:

<script language="JavaScript" type="text/javascript">

var sMyName = self.opener.getMyName();

/*

    the variable sMyName has the value of "Matt Warden"
    because it is returned by the function getMyName()
    in the opener window.

*/

</script>


That look right? Been a while since I did this with JavaScript. This (well,
similar) technique is used a lot with Java classes. Rather than grabbing
attribute values like Classname.attribute, attributes would be inaccessable,
except from the method Classname.getAttribute(). Kinda the same thing.

HTH,

--
mattwarden
mattwarden.com


> Thank you very much for your help.  One question: could you tell me more
> about the getMyVariableValue() method,  or at least the simplest way of
> putting variable values in a separately opened web browser page?






More information about the thelist mailing list