Ajax - Simple Javascript Ajaxing
var data = Ajax.get(url);
Ajax is a simple class for Ajax support in Javascript. It supports get, put and post methods. It supports synchronous and asynchronous requests. It supports basic auth for requests.
Ajax has the following methods:
Ajax.get(url [, callback, params]);
Ajax.put(url, data [, callback, params]);
Ajax.post(url, data [, callback, params]);
url
is always required.
data
is required for put
and post
.
If you don't specify a callback
for any of these, the function is
synchronous and returns the resulting content.
params
is an object of extra parameters. The valid parameters are:
put
or post
. You may nee to call
encodeURIComponent()
on this string.
Ingy döt Net <ingy@cpan.org> Kang-min Liu <gugod@gugod.org> Chris Dent <cdent@burningchrome.com>
Copyright (c) 2006, 2007. Ingy döt Net. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.