Creating an IFRAME that displays google.com

Getting ready

In preparation for this one, some back-story is warranted. One useful tag in the HTML specification was not always supported by all major browsers, the IFRAME. The tag is now supported by all major browsers.

How to do it...

Use the SRC attribute to set the external or internal page to be displayed within this specified division of the page.

<form action="javascript:" method="get"> <input id="submit" type="button" value="i can has search?"/> </form> <noscript>JavaScript is disabled.</noscript> <script type="text/javascript"> $('submit').addEvent('click', function() { // use mootools to create an iframe element new Element('iframe', { 'src' : 'http://google.com', 'frameborder': 1, 'width' : ...

Get MooTools 1.3 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.