nenads / ajax

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ajax Request/Response Library

Installation

<script src="/path/to/ajax-request.js"></script>

Basic Usage

Request

var ajax = AjaxRequest();

ajax.request({
	url: 'path/to/ajax.php',
	data: {
		foo: 'bar'
	}
});

Response

include 'AjaxResponse.php';

$ajax = new AjaxResponse();

$ajax->alert('foo');

echo json_encode($ajax->get());

About