OLD | NEW |
(Empty) | |
| 1 |
| 2 <!--- |
| 3 |
| 4 This README is automatically generated from the comments in these files: |
| 5 iron-ajax.html iron-request.html |
| 6 |
| 7 Edit those files, and our readme bot will duplicate them over here! |
| 8 Edit this file, and the bot will squash your changes :) |
| 9 |
| 10 --> |
| 11 |
| 12 [](https://travis-ci.org/PolymerElements/iron-ajax) |
| 13 |
| 14 _[Demo and API Docs](https://elements.polymer-project.org/elements/iron-ajax)_ |
| 15 |
| 16 |
| 17 ##<iron-ajax> |
| 18 |
| 19 |
| 20 The `iron-ajax` element exposes network request functionality. |
| 21 |
| 22 <iron-ajax |
| 23 auto |
| 24 url="http://gdata.youtube.com/feeds/api/videos/" |
| 25 params='{"alt":"json", "q":"chrome"}' |
| 26 handle-as="json" |
| 27 on-response="handleResponse" |
| 28 debounce-duration="300"></iron-ajax> |
| 29 |
| 30 With `auto` set to `true`, the element performs a request whenever |
| 31 its `url`, `params` or `body` properties are changed. Automatically generated |
| 32 requests will be debounced in the case that multiple attributes are changed |
| 33 sequentially. |
| 34 |
| 35 Note: The `params` attribute must be double quoted JSON. |
| 36 |
| 37 You can trigger a request explicitly by calling `generateRequest` on the |
| 38 element. |
| 39 |
| 40 |
| 41 |
| 42 ##<iron-request> |
| 43 |
| 44 |
| 45 iron-request can be used to perform XMLHttpRequests. |
| 46 |
| 47 <iron-request id="xhr"></iron-request> |
| 48 ... |
| 49 this.$.xhr.send({url: url, params: params}); |
| 50 |
OLD | NEW |