ic-src - The Source Attribute

Summary

The ic-src attribute binds a given HTML element to a URL. It does not cause any requests to happen by itself, but it can respond to events caused by other attributes, such as ic-poll or ic-post-to.

When Intercooler issues a request for an element with an ic-src, it will issue a GET and will replace the current elements content with resulting HTML fragment, if it is different than the current content.

Syntax

The value of the attribute should be a valid relative path (e.g. ic-src="/foo/bar").

Dependencies

ic-src implies a dependency on its path, and Intercooler will issue requests for elements whenever it detects an action that the path depends on. See Dependencies for more information.

Example

Here is a simple example, using a poll interval to update:

  <div ic-src="/seconds" ic-poll="5s">You have been on this page for 0 seconds...</div>
      
You have been on this page for 0 seconds...