Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Javascript / Client Side Development

How to refer to a function in a frame from another frame?


Hi,

I have this master frameset page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Account Creation</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=ISO-8859-1">
</HEAD>

<frameset rows="0%, 100%">
        <frame src="creation_result.php" name="createAccount">
        <frame src="display_result.php" name="content">
</frameset>

</html>

>From within the "createAccount" frame, I want to call a function

defined in the content frame.  The content frame's HTML is roughly as
follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Account Creation</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="../styles/styles.css">
<script type="text/javascript" src="../scripts/util.php"></script>
<script type="text/javascript" src="../scripts/util.js"></script>
<script type="text/javascript">
        function setMsg(msg) {
                document.getElementById('m').innerHTML = msg;
        }   // setMsg
</script>
</HEAD>
<BODY>
...
</body>
</html>

How do I refer to the "setMsg" function in the content frame from the
other frame (named "createAccount"?

Thanks, - Dave

laredotorn@zipmail.com said the following on 5/21/2007 12:20 PM:

> Hi,

<snip>

> How do I refer to the "setMsg" function in the content frame from the
> other frame (named "createAccount"?

parent.frames['createAccount'].functionName()

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc