--- layout: default nav: why ---

## Why Use Intercooler?

In a word: simplicity.

With intercooler you can add AJAX to your application without using client-side models, routing, validation, rendering, factories or dependency injection.

In fact, you don't need to write any javascript at all.

## How Does That Work?

Intercooler is a natural extension of HTML: simple attributes with a familiar syntax are all that is required to add AJAX requests to your application.

Intercooler does use javascript to communicate with a server, but the events triggering the requests are described with HTML attributes (or are simply implied) rather than with imperative javascript.

Rather than expecting a JSON response from the server, intercooler expects HTML. This HTML is then loaded into the DOM directly.

This is in contrast with Javascript MVC frameworks such as Ember.js or Angular.js, which typically use JSON as a data transport and have much more involved client-side binding and rendering.

Below is a diagram showing an intercooler request:

The AJAX response is a bit of HTML generated by the server, which is swapped into the DOM in place of the existing content.

This technique is fast and simple.

Intercooler was inspired by Turbolinks and, particularly, by the excellent pjax library.

## The Zen of Intercooler

"The minimum complexity compatible with user joy."