in the parent window:
<script>
function OnFrameButtonClick () {
alert ("You clicked on a button in the frame");
}
</script>
in the child frame window:
<head>
<script>
function OnButtonClick () {
// check whether the parent window and the OnFrameButtonClick method exist
if (window.parent && parent.OnFrameButtonClick) {
parent.OnFrameButtonClick ();
}
}
</script>
</head>
<body>
<button onclick="OnButtonClick ()">Test</button>
</body>
You can find further examples on the following sites:
沒有留言:
張貼留言