Skip to content

Commit

Permalink
Changed query and added tip for environment
Browse files Browse the repository at this point in the history
table search.news seems to be dropped. Added tip with environment to access community tables and added link to a demo jsfiddle.

Added blank line after code block & removed blank lines at the end

removed link to jsfiddle. Not really needed.
  • Loading branch information
AWolf81 committed Jun 8, 2015
1 parent 334a910 commit 939b4be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion page/ajax/working-with-jsonp.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $.ajax({
// Tell YQL what we want and that we want JSON
data: {
q: "select title,abstract,url from search.news where query=\"cat\"",
q: "select * from search.ec (1, 10) WHERE keyword='New York'",
format: "json"
},
Expand All @@ -31,4 +31,6 @@ $.ajax({
});
```

If you'd like to access community tables you have to add `env: "http://datatables.org/alltables.env"` to the data object otherwise you would get an error message with `No definition found for Table`.

jQuery handles all the complex aspects of JSONP behind-the-scenes — all we have to do is tell jQuery the name of the JSONP callback parameter specified by YQL ("callback" in this case), and otherwise the whole process looks and feels like a normal Ajax request.

0 comments on commit 939b4be

Please sign in to comment.