11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

function send(sendValue)<br />

{<br />

var newLocation =<br />

'iframeResponse.php?sendvalue='+escape(sendValue);<br />

}<br />

theIframe.src = newLocation;<br />

function RPC<strong>Complete</strong>(msg)<br />

{<br />

}<br />

//-->><br />

var region = document.getElementById('response');<br />

region.innerText = msg;<br />

<br />

<br />

<br />

In this case the iframeResponse.php program takes the message and responds back to the<br />

user by invoking the RPC<strong>Complete</strong>() function in the main window. Here is a fragment of a<br />

possible server-side script in PHP to handle the RPC. <strong>The</strong> value $message was calculated<br />

previously—we aim here only to show how the callback works.<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!