0

In the qooxdoo playground there is a YQL binding sample. I want to see what data comes back from querying the URL.

How can I modify this code:

var delegate = {manipulateData : function(data) {

  return data.query.results.item;
}};

so that I can view the return data? I've tried this.debug(data) and pressing F7 but I dont see any data there.

Terrence Brannon
  • 4,760
  • 7
  • 42
  • 61

1 Answers1

1

Because you're inside an object the keyword this points to the object itself.

So you either have to use:

  • qx.log.Logger.debug(data) in order to print into the Log area of the playground (and the browser console)
  • or just use console.log(data) and inspect the object solely within your browser console.

So it would look like this:

var delegate = {manipulateData : function(data) {
  console.log(data);
  return data.query.results.item;
}};
  • `console.log(data)` does nothing on IE6. `qx.log.Logger.debug(data)` yields `11289610 {query:{...(4)}}` ... so how do I get it to show the data structure in detail? Granted in this case, I can simply go to the yql page and play with their testbed, but I really want to know how to do this in general when such resources are not available. – Terrence Brannon Jan 30 '13 at 20:10
  • IE6 is unfortunately your worst browser choice :(. I recommend you to try for example [Firefox](http://www.mozilla.org/en-US/firefox/fx/). – Richard Sternagel Jan 30 '13 at 21:47
  • Anyway, if you use `qx.log.Logger.debug(data).query` you see more in the Log area. But this will be tedious because you can't "browse" the object like in a browser console. If you are only interested in the result of the YQL query, then maybe the [YQL Console](http://y.ahoo.it/W7EvQ) is for you. You have to switch to 'JSON', remove the 'cbfunc' and then hit 'Test'. This should be the same object which you get in the playground sample. – Richard Sternagel Jan 30 '13 at 22:08