Here is the documentation for Request.js.
The Request class is a relatively simple wrapper for the XMLHttpRequest object (the heart of Ajax functionality).
It takes the following options:
Then you'll need to call the .send method to actually initiate a request. .send takes two arguments, the url, and the data to send.
new Request({method: 'get'}).send('http://site.com/requestHandler.php?name=john&lastname=doe');
MooTools has a "built-in" instance of Request that you can use to send a form with an ajax post request.
<form id="myForm" action="submit.php"> <input name="name" value="bob"> <input name="zipCode" value="90210"> </form> <script> $('myForm').send({onComplete: handleMyResponse}) </script>
You can use set to alter the options of the "built-in" version of Request:
$('myForm').set('send', { method: 'get' }); $('myForm').send();