Book Image

MooTools 1.2 Beginner's Guide

Book Image

MooTools 1.2 Beginner's Guide

Overview of this book

MooTools is a simple-to-use JavaScript library, ideal for people with basic JavaScript skills who want to elevate their web applications to a superior level. If you're a newcomer to MooTools looking to build dynamic, rich, and user-interactive web site applications this beginner's guide with its easy-to-follow step-by-step instructions is all you need to rapidly get to grips with MooTools.
Table of Contents (14 chapters)
MooTools 1.2 Beginner's Guide
Credits
About the Authors
About the Reviewer
Preface

Time for action—sending data to PHP


We're going to demonstrate how powerful Ajax is via a simple example; we're going to send a PHP script a string, and it will reverse the string as we type. We do this by asynchronously updating the web page as the user presses on their keyboard.

This involves server-side scripting, and we'll use one of the most widely-available languages out there—PHP. Chances are, your web server has the capability to run PHP files (and if you followed my advice on installing XAMPP, you're all set). Don't worry, we won't be working with complex PHP and if you know any language, even just JavaScript, you'll understand what's going on.

This simulates more complex examples, such as sending in a user string, which PHP, or your preferred server-side scripting language, processes to query the database and check if that user string exists. Depending on the query's result, it will respond to MooTools accordingly.

  1. We'll start by creating our web page. The structure of our document...