Anandhi Subramani
Anandhi Subramani

Reputation: 1

Polymer returning JSON object on AJAX success not using jquery

I'm trying to animate SVG images based on the degree provided by user. The requirement is that I have to read the degree from an external JSON file. I'm new to polymer so how can this be achieved?

Upvotes: 0

Views: 187

Answers (1)

Neil John Ramal
Neil John Ramal

Reputation: 3734

You can use iron-ajax.

Here's an example:

<iron-ajax url="post.json" auto last-response="{{theResponse}}"></iron-ajax>

The url attribute here refers to the url target of the request, auto means that it performs the request either when the url or params changes, and last-response refers to the last response object you received.

Upvotes: 3

Related Questions