Skip to content

Commit 6c705e1

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.
1 parent 334a910 commit 6c705e1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

page/ajax/working-with-jsonp.md

Lines changed: 5 additions & 1 deletion
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
@@ -30,5 +30,9 @@ $.ajax({
3030
}
3131
});
3232
```
33+
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`.
3334

3435
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.
36+
37+
You can find a working demo of the code in this [jsFiddle](http://jsfiddle.net/awolf2904/18kk18tj/).
38+

0 commit comments

Comments
 (0)