October 2017
Intermediate to advanced
370 pages
8h 57m
English
Why go to the trouble of setting up server generated page and form submission when AMP, with the help of amp-bind, gives us everything we need already? Yes, we can do this without the server script!
Along with the usual AMP boilerplate, we'll start with some initial data, set by amp-state (/ch9/search-map.html):
<amp-state id="props"> <script type="application/json"> { "input": "planet+earth" } </script></amp-state>
We're going to use props.input to store the user's search keywords. When the user enters some text we'll use the on="change:..." event to update props.input. We'll also bind props.input to the query parameter of the iframe src URL, so when the query changes the map will be updated. In this way ...
Read now
Unlock full access