I am trying to display content from a YQL Query. However, the value I am entering into my text field is returning a value of undefined when I submit it, thus causing the YQL query to fail.
Along with this issue, I’m not sure how to select just the titles from the data argument in the callback function for the getJSON function in this portion of my code:
//Return the JSON results of the YQL query
$.getJSON(restQuery, function(data) {
//Display the returned results in the searchResults div
$("#searchResults").html(data);
});
Here is the JSFiddle of my code: http://jsfiddle.net/JAS4H/30/
Thanks in advance for any help!
I’ve cleaned up your code a bit.
Demo: http://jsfiddle.net/JAS4H/33/
As you can see, the response data is not JSON – that’s why $.getJSON() does not work. For instance, if you search for “cars”, you will get this response:
This is JSONP I believe …