May I supply this very little example to show how easy it can be to use iFrame?

This is the first document:

<iframe id=myFrame></iframe>
<input type=button value=go
   onclick="document.getElementById('myFrame').src='second.htm'" />
<div id=myDiv></div>

It just has an iframe, an action button, which sets the src property of the iframe and a div to store the response.

The document second.htm contains:

<body onLoad="parent.document.getElementById('myDiv').innerHTML = 'hello!';" />

That's it.

I placed this in the onLoad event, to make sure nothing gets executed before everything is loaded, but I might as well do this:

<script>parent.document.getElementById('myDiv').innerHTML = 'Hello!';</script>

And it also works, though should it invoke a function not yet loaded, it would fail. Instructions set as this last one might move a progress bar while the scripts are being loaded. For example, if the information sent comes from database records, a row count can be queried first and insterspersed with the actual data of the rows, a progress bar might be moved a fraction of that row count. (this would count for communication from the server to the browser since that bar wouldn't move until the first instruction of the response is received)

This, of course, are very minimal documents just containing what's essential to prove the point, not working documents and, of course, both might be PHP scripts.

Satyam
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to