Hello everyone,
I am building a page that has two iframes (xFrame1, and xFrame2) in it.
Both the pages in the frames are the same and have like JavaScript function names within them.
I want to call a function on the parent page that would call the like named function within the selected iframe by passing in a value in the function on the parent page.
Here is my code on the parent page:
Here is my code on the framed pages (xPage.htm):
Can anyone help me out here?
Thanks~
I am building a page that has two iframes (xFrame1, and xFrame2) in it.
Both the pages in the frames are the same and have like JavaScript function names within them.
I want to call a function on the parent page that would call the like named function within the selected iframe by passing in a value in the function on the parent page.
Here is my code on the parent page:
Code:
<html>
<head>
<title></title>
<script type="text/javascript">
function UpdateFrame(FrameId)
{
parent.('xFrame'+ FrameId).UpdatePage();
}
</script>
</head>
<body>
<label onclick="UpdateFrame(1);">Click Me to update frame 1</label>
<label onclick="UpdateFrame(2);">Click Me to update frame 2</label>
<iframe id="xFrame1" src="xPage.htm"></iframe>
<iframe id="xFrame2" src="xPage.htm"></iframe>
</body>
</html>
Here is my code on the framed pages (xPage.htm):
Code:
<html>
<head>
<title></title>
<script type="text/javascript">
function UpdatePage()
{
window.location='http://bytes.com'
}
</script>
</head>
<body>
Hello World
</body>
</html>
Can anyone help me out here?
Thanks~
Comment