In this recipe, we make a browser app ask data from a web service (Yahoo stock data) in JSON format, decode that data, and dynamically build up the web page showing the data.
This is what the URL we will use will look like: http://query.yahooapis.com/v1/public/yql?q=SELECT.
To get the data, we use the Yahoo Query Language (YQL),
q= indicating the start of the query represented by
SELECT. Suppose we want to look up stock data for Yahoo, Google, Apple, and Microsoft, the selected query will be of the following form:
select * from yahoo.finance.quotes where symbol in(YHOO,AAPL,GOOG,CMSFT) &env=http://datatables.org/Falltables.env&format=json
Look at the code in
import 'dart:html'; ...