Dynamic Content and Data-Driven Interaction

In the last chapter, we saw how we could send and receive data to and from a server endpoint using forms. A drawback was that we couldn't fetch any data without user interaction--the user had to submit a form before any data was retrieved. While that model has its uses, it's not suitable for all situations. We couldn't, for example, show the contents of a shopping cart when the user arrived on a page--we'd have to wait for the user to interact with the page first.

In this chapter, we'll see a solution to this issue, so that we can dynamically fetch server data on page load, or when triggered by user interaction, using amp-list. We'll also explore other use cases for dynamic content and data in AMP ...

Get AMP: Building Accelerated Mobile Pages now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.