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

Building a calculator using Ajax

Included with the book are two versions of the calculator processor, the server-side script that processes the Ajax requests and provides responses. All server-side scripts used in recipes in this book have both a PHP and ColdFusion version. The recipe below, as all do, shows the PHP script installed in the URL of the Ajax call; one must only switch the file ending to .cfm to use the ColdFusion version. The two scripts process identically.

How to do it...

There are five main code blocks in the JavaScript; we will stop before each code block to review in detail.

<script type="text/javascript" src="mootools-1.3.0.js"></script> </head> <body> <div id="main"> <h1>Mortgage ratio calculator</h1> <form action="javascript:" ...

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