Last active
August 29, 2015 14:07
-
-
Save TzuYangLin/e261390e9a558ad3d789 to your computer and use it in GitHub Desktop.
Example: Call function in another frame
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Try: | |
<frameset col"50%,*"> | |
<frame src="page1.htm"> | |
<frame src="page2.htm" name="otherFrameName"> | |
</frameset> | |
//Then in page1.htm: | |
<script language="JavaScript"> | |
parent.otherFrameName.functionName(); | |
</script> | |
//Then in page2.htm: | |
<script language="JavaScript"> | |
function functionName() { | |
alert('Hello world'); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment