--- layout: default nav: attributes > all ---

## Intercooler Reference

### HTML Attributes

Attribute | Description
--- | ---
ic-action | This attribute allows you to make client-side modifications (e.g. element removal) to the DOM without a server request.
ic-action-target | This attribute allows you to change the target of a `ic-action` attribute
ic-add-class | This attribute allows you to add one or many classes to an element after a specified time delay.
ic-append-from | When triggered this attribute will issue a `GET` and append all content returned to the children of the element it is on.
ic-attr-src | Like `ic-style-src`, this attribute allows you bind to a URL. However, this attribute binds an attribute value to a URL. The syntax is "attribute:url". For example, to bind the style of an element to "/style/random", you would say `ic-attr-src="style:/style/random"`
ic-confirm | This attribute can be used to confirm an action with a user before proceeding.
ic-delete-from | This attribute allows you to bind the "action" of an element to a given URL. Once it is bound, when an "action" occurs (e.g. clicking a button) Intercooler will issue a `DELETE` to the URL and replace the element with the new content. Intercooler will detect any other elements that the `DELETE` effects and automatically refresh them.
ic-deps | This attribute allows you to express additional path dependencies for a given element, beyond the implied ones.
ic-disable-when-doc-hidden | Disables requests when a document is hidden (e.g. for polling)
ic-disable-when-doc-inactive | Disables requests when a document is inactive, that is it does not have focus (e.g. for polling)
ic-enhance | This attribute tells intercooler to enhance all anchor tags and form tags that it founds, adding the equivalent AJAX functionality to them.
ic-fix-ids | This attribute tells Intercooler to replace the IDs of any added elements with globally unique IDs so that they don't conflict with any existing IDs on the page.
ic-get-from | This attribute allows you to bind the "action" of an element to a given URL. Once it is bound, when an "action" occurs (e.g. clicking a button) Intercooler will issue a `GET` to the URL and replace the element with the new content.
ic-global-include | This attribute can be used to add data to all requests made by Intercooler
ic-global-indicator | This attribute tells Intercooler to show the specified global indicator, in addition to whatever local indicators an element might want shown.
ic-history-elt | This attribute attribute tells intercooler the element to take a snapshot of when storing history entries, as well as the element to restore history snapshots into.
ic-include | A selector attribute that can be used to include additional input with an action request (e.g. can be used to include a form with an unrelated button.)
ic-indicator | This attribute can be used to show a progress indicator while an Intercooler AJAX request is in flight.
ic-limit-children | Limits the number of children that an element is allowed to have after an `ic-prepend-from` or `ic-append-from` fires.
ic-local-vars | A comma separated list of variables from `localStorage` to include intercooler requests.
ic-on-beforeSend | This attribute allows a script to be evaluated during the beforeSend stage of AJAX requests made on behalf of Intercooler.
ic-on-beforeTrigger | This attribute allows a script to be evaluated before a trigger is processed.
ic-on-complete | This attribute allows a script to be evaluated after any AJAX requests made on behalf of Intercooler.
ic-on-error | This attribute allows a script to be evaluated after unsuccessful AJAX requests made on behalf of Intercooler.
ic-on-success | This attribute allows a script to be evaluated after successful AJAX requests made on behalf of Intercooler.
ic-patch-to | This attribute allows you to bind the "action" of an element to a given URL. Once it is bound, when an "action" occurs (e.g. clicking a button) Intercooler will issue a `PATCH` to the URL and replace the element with the new content. Intercooler will detect any other elements that the `PATCH` effects and automatically refresh them.
ic-pause-polling | If `true` then an `ic-poll` attribute will not start polling. This can be used to implement a Pause/Play UX.
ic-poll | This attribute tells Intercooler to poll the source URL for the element it is on in a given interval, expressed as milliseconds or seconds. (e.g. '500ms' or '2s')
ic-poll-repeats | This attribute limit the number of polling calls (e.g. '5')
ic-post-errors-to | Allows you to specify a URL to post javascript errors to that occur when intercooler is making requests and swapping content.
ic-post-to | This attribute allows you to bind the "action" of an element to a given URL. Once it is bound, when an "action" occurs (e.g. clicking a button) Intercooler will issue a `POST` to the URL and replace the element with the new content. Intercooler will detect any other elements that the `POST` effects and automatically refresh them.
ic-prepend-from | When triggered this attribute will issue a `GET` and prepend all content returned to the children of the element it is on.
ic-prompt | This attribute allows you to prompt the user before intercooler issues a request.
ic-push-url | This attribute tells Intercooler to update the current location with the target URL of the element after a successful AJAX request, with history support.
ic-push-params | This attribute tells Intercooler to include the given parameters in the URL that is pushed via the `ic-push-url` attribute.
ic-put-to | This attribute allows you to bind the "action" of an element to a given URL. Once it is bound, when an "action" occurs (e.g. clicking a button) Intercooler will issue a `PUT` to the URL and replace the element with the new content. Intercooler will detect any other elements that the `PUT` effects and automatically refresh them.
ic-remove-after | This attribute tells Intercooler to remove the element it is on after the given amount of time has elapsed.
ic-remove-class | This attribute allows you to remove one or many classes to an element after a specified time delay.
ic-replace-target | If this attribute is set to "true", the target element of the intercooler request will be replaced entirely with the server response, rather than replacing the inner HTML of the element. This is useful in cases where you cannot wrap an element around a potential target easily, like table rows.
ic-scroll-offset | An offset in pixels to adjust the scroll position when using the `ic-scroll-to-target` attribute
ic-scroll-to-target | If this attribute is set to "true", the target element of the intercooler request will have its top scrolled into the viewport if it is not visible. The scroll destination can be adjusted using the `ic-scroll-offset` attribute.
ic-select-from-response | This attribute tells Intercooler to filter the servers response to content matching the given CSS selector. This can be useful for making a full HTML response act like a partial response.
ic-src | This attribute allows you to bind an element to a given URL. Once it is bound, when a change occurs that Intercooler recognizes as affecting the URL (or given an event such as a poll), Intercooler will issue a `GET` to the URL and replace the element with the new content.
ic-sse-src | This attribute allows you to bind an element to a given Server Sent Event endpoint and update the elements content or trigger Server Sent events on child elements.
ic-style-src | Like `ic-src`, this attribute allows you bind to a URL. However, this attribute binds a style attribute to a URL. The syntax is "style-attribute:url". For example, to bind the color of an element to "/color/random", you would say `ic-style-src="color:/color/random"`
ic-swap-style | Allows you to specify the swap mechanism that intercooler will use with content received from the server
ic-switch-class | Allows you to swap a class amongst sibling elements in a DOM when an intercooler event is triggered. This can be used, for example, to switch an `active` class between tabs without replacing the HTML.
ic-target | This attribute is often used with an action attribute (e.g. `ic-post-to`) in order to target the content of another element for replacement.
ic-transform-response | A javascript expression that transforms the given server response into HTML to be swapped into the DOM
ic-transition-duration | An amount of time to wait between starting a transition and executing a content swap.
ic-trigger-delay | This attributes delays the execution of a trigger and, if the trigger occurs again within the given interval, cancels the original trigger in favor of the new one, which will begin waiting for the interval again.
ic-trigger-from | This attribute can be used to listen for events on other elements in the DOM, or the document or window.
ic-trigger-on | This attributes changes the event on which the element is loaded via `ic-src`. It can be used to implement lazy loading of images or charts, infinite scrolling, etc.
ic-verb | This attribute allows you to override the HTTP verb to use in a request.

### Request Parameters & Headers

{% include request_api.html %}

### Response Headers

{% include response_api.html %}

### Javascript Events

{% include events_api.html %}

### Javascript API

{% include javascript_api.html %}

### Meta Tags

Meta Tag | Description
--- | ---
`<meta name="intercoolerjs:use-data-prefix" content="true"/>` | By setting this meta-tag value, you will be able to use the `data-*` prefix for all intercooler attributes, making your HTML validatable.
`<meta name="intercoolerjs:use-actual-http-method" content="true"/>` | By default intercooler uses the `POST` HTTP method for all non-`GET` actions, passing the actual method up with the `_method` parameter as well as the `X-HTTP-Method-Override` header, in order to support browsers with incomplete AJAX implementations. If you wish to use the actual HTTP method in the AJAX call (e.g. `DELETE`) and not worry about legacy browswers, you can set this meta-tag value to "true".