Jump to content

Iframe problem


pankaj.ghadge

Recommended Posts

If you don't want the main page to reload, you're going to have to use Javascript to retrieve the form values from the <input> elements and use them in the main page however needed, accessing the window._parent object.

Link to comment
Share on other sites

NOTE. I have drastically oversimplified this markup for the sake of demonstration. Please use best practices in your own documents.Let's call this file shell.html:

<html>	<head>		 <script type="text/javascript">			function help (m) {				alert(m);			}		</script>	</head>	<body>		<iframe src="myframe.html"></iframe>	</body></html>

This file is myframe.html:

<html>	<head>		<script>			function send () {				window.parent.help("HELLO!");			}		</script>	</head>	<body>		<button onclick="send()">send</button>	</body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...