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

Displaying remote data via Ajax within a DIV

This recipe gets us ready for this chapter where Ajax is an idea of grabbing external data and bringing it into our current, already loaded page.

Getting ready

Prepare a small web page that is loaded with a static data "hello world". Name it 05_hello_world.html.

<html>
<head><title>Display Local Data via Ajax Within A DIV</title></head>
<body>Hello World</body>
</html>

How to do it...

We will simply be loading this page via Ajax into the DOM on our page.

<script type="text/javascript" src="mootools-1.3.0.js"></script> </head> <body> <form action="javascript:" method="get"> <input type="button" id="mybutton" value="Ajax!" onclick="myJax.send();"/> </form> <fieldset style="padding:10px;"><legend>My Ajax ...

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