PolymerElements/iron-ajax

Name: iron-ajax

Owner: PolymerElements

Description: Easily make ajax requests

Created: 2015-04-16 16:47:01.0

Updated: 2018-05-24 09:38:57.0

Pushed: 2018-05-23 02:26:49.0

Homepage: https://www.webcomponents.org/element/PolymerElements/iron-ajax

Size: 439

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build status

Demo and API docs

Changes in 2.0
<iron-ajax>

The iron-ajax element exposes network request functionality.

n-ajax
auto
url="https://www.googleapis.com/youtube/v3/search"
params='{"part":"snippet", "q":"polymer", "key": "YOUTUBE_API_KEY", "type": "video"}'
handle-as="json"
on-response="handleResponse"
debounce-duration="300"></iron-ajax>

With auto set to true, the element performs a request whenever its url, params or body properties are changed. Automatically generated requests will be debounced in the case that multiple attributes are changed sequentially.

Note: The params attribute must be double quoted JSON.

You can trigger a request explicitly by calling generateRequest on the element.

<iron-request>

iron-request can be used to perform XMLHttpRequests.

n-request id="xhr"></iron-request>

.$.xhr.send({url: url, body: params});

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.