O'Reilly logo

MooTools 1.3 Cookbook by Jay Larry G. Johnston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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' : ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required