PDA

View Full Version : How do I access variables from a child iframe?



MeTechPerson
Sep 12th, 2007, 12:34 AM
Hello,

I have an HTML page (A) with an iframe inserted in it. In this iframe (B) there are variables that I want to access and post their values to the HTML page (A) that houses the iframe (B). How do I access the variables in iframe (B) from and post to HTML page (A)?

Right now my code looks like this:

HTML PAGE: (A)

<html>
<body>

<div id="breadCrumb">
<script language="javascript">document.write('breadCrumb');</script>
</div>

<script>
<!-- iframe content populate here -->
document.write(iframeVar);
</script>

</body>
</html>

IFRAME CONTENT (B)
<html>
<head>
<script type="text/javascript">

var breadcrumb
breadCrumb = scoTitle + " / " + menuObject.L1.title
</script>
</head>
<body>
content
</body>
</html>

how do I get the main page to recognize the variables in the iframe. The variables in the iframe dictate what page its on and the page details to be populated on the main page outside the iframe.

MeTechPerson
Sep 12th, 2007, 03:48 PM
anyone?