PDA

View Full Version : Child to Parent variable passing...


latinomigs
09-17-2004, 05:47 PM
Hi,

I have a webpage with an iframe named "content". In the page inside the iframe (home.html) there is a variable called 'thepagename' with a value of "Home" (var thepagename = "Home";).

In the <head> of the parent there is the following script:

<script language="JavaScript">
<!--
var currPage;

currPage = window.content.thepagename.value;

function pageCheck(){
alert(currPage);
}
// -->
</script>

in the <body> the following link:

What is the current page name? (javascript:pageCheck();)

My reference is incorrect. What is the appropriate way to get the value of "thepagename" so that it passes to my function above?

Thanks