Documenation

AJAX

AJAX is a technique used to create interactive web applications. Swiftlet comes bundled with jQuery, a JavaScript library that handles AJAX interactions (among other things such as event handling and animations).

Example POST request

01
02
03
04
05
06
07
08
09
10
<div id="result"></div>

<script type="text/javascript">
    $('#result').load('ajax.php', {
        'key': 'value',
        'auth-token': '<?php echo $model->authToken ?>'
    }, function() {
        alert('Success!');
    });
</script>

Note that as with forms, requests made using POST (strongly recommended for making safe AJAX requests) should include the auth-token field or the request will fail (an error 503 header is returned).

See the jQuery AJAX API for more information.

See also