Remote Scripting with iframes - Other uses
(Page 4 of 4 )
There are many other things that can be done using iframes for remote scripting. For example, a form in the main page could be used to send user input to the script in the iframe, and the script could display a response in the iframe, with no page reloads necessary.
Here's another example: dynamically generated information could be sent from a script in the main page to a script in the iframe without human input. I'm quite certain you can think of other possibilities for iframes. Feel free to play around with the code I've included in these two articles. You might come up with any number of applications that suit the needs of your website.
Conclusion
While iframes are not the ideal tool for every remote scripting task, they do have two significant advantages: simplicity, and fewer problems with the behavior of the back button. I'm sure you can think of many more uses in addition to the ones described in this article.
Oh! And what about that remote procedure call (RPC) that I promised you? Guess what -- we just made one (or Joe did)! RPC is a term used to describe communication or exchange of data between remote computer systems, and what Joe did qualifies as that. If you want a lot of complicated code, you will have to find some other article.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |