AjaSL



AjaSL (developed by SomeLuigi), is a simple library to simplify AJAX/XMLHttpRequest. It provides a simple, cross-browser construction. To provide a callback, you can pass an anonymous function at creation.

Library Types
new AjaSL( function ( success, code, response ) );

it can be constructed as follows:
sender = new AjaSL( function (success, code, response) { if (success) { alert('It was successful!'); } else { alert('Not successful - code: ' + code); } };

Please see the demo page for a try-it-yourself demo and better implemented examples.


Methods of AjaSL
ajasl.url('aurl.php');

Requests from the URL with no GET or POST paramaters. Due to browser XSS protection, this must be on the same domain as the script.

ajasl.get('aurl.php', {param1: 'value1'});

Requests from the URL with GET paramaters. Due to browser XSS protection, this must be on the same domain as the script.

ajasl.post('aurl.php', {param1: 'value1'});

Requests from the URL with POST paramaters. Due to browser XSS protection, this must be on the same domain as the script.

ajasl.getpost('aurl.php', {param1: 'value1-get'}, {param1: 'value1-post'});

Requests from the URL with GET and POST paramaters. Due to browser XSS protection, this must be on the same domain as the script.

ajasl.resend();

Resubmits the previous request; good to use if an error occurred.



Demo / Try it now

Demo coming soon.

Download