Skip to content

Commit 939b4be

Browse files
committed
Changed query and added tip for environment
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.
1 parent 334a910 commit 939b4be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

page/ajax/working-with-jsonp.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $.ajax({
2020
2121
// Tell YQL what we want and that we want JSON
2222
data: {
23-
q: "select title,abstract,url from search.news where query=\"cat\"",
23+
q: "select * from search.ec (1, 10) WHERE keyword='New York'",
2424
format: "json"
2525
},
2626
@@ -31,4 +31,6 @@ $.ajax({
3131
});
3232
```
3333

34+
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`.
35+
3436
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 commit comments

Comments
 (0)