--- layout: default nav: tutorial ---

Lazy Loading A Div

This example lazily loads an expensive to calculate graph in a div within the page, allowing the page to respond immediately.

Note that the "server side" implementation is mocked out using mockjax, so you can see the entire implementation. Click the "Source Code" tab to see the code.

Explanation

  • A div within the page loads a graph from another URL using the ic-get-from attribute. In order to trigger the loading when the page loads, the ic-trigger attribute is set to "load".
  • A progress indicator is nested in the div with the ic-indicator class on it, to be shown as the request for the lazily loaded content is in flight.

Demo

Tokyo Climate Graph

Loading Graph...