I am trying to make an instant search functionality within json. The code seems right but definitely doesn’t work. Would you please guys have a look and help me to fix it? Thanks in advance.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your JSONP represents the data that your AJAX call recieves. It looks like this:
The outermost node is an array. To access the first element in that array you can use an indexer:
response[0]. The question then is “What do you want from your data?”Judging from your js, you probably want to loop over the whole response, and pull
id,titleandpermalinkfrom each item. This ought to do for your callback:http://jsfiddle.net/hMyr7/15/.