JavaScript Twitter typeahead - why does it only match one result?

I'm using the Twitter Typeahead plugin:

https://twitter.github.io/typeahead.js/

Here is the code I'm using:

$(document).ready( function() {

  var bestPictures = new Bloodhound({
    datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
    queryTokenizer: Bloodhound.tokenizers.whitespace,
    prefetch: '/cgi-bin/admin-daily.cgi',
    remote: {
      url: '/cgi-bin/admin-daily.cgi?q=%QUERY',
      wildcard: '%QUERY',
      filter: function (parsedResponse) {
            console.log(parsedResponse);
            return parsedResponse;
        }
    }
  });

  $('#showSearchResults .typeahead').typeahead(null, {
    name: 'best-pictures',
    display: 'value',
    source: bestPictures,
    templates: {
      empty: [
        '<div class="empty-message">',
          'unable to find any matches',
        '</div>'
      ].join('\n'),
       suggestion: function(data){
         console.log(data);
         return Mark.up("<img src=\"{{image_url}}\" style=\"height:50px\"> <strong>xx{{title}}yy</strong>", data);
       }
    }
  });

});

Now, this kinda works - but it only seem to get 1 result. Here is the JSON that gets returned with my request:

[{"image_url":"https://steampunk-d72.kxcdn.com/daily/7/817-YlMCxegOPpB5Dsob8rw.jpg","title":"Steampunk Bike","id":"819"},{"image_url":"https://steampunk-d72.kxcdn.com/daily/1/1041-w0ScJAzItAnL3iFL7Ji1A.jpg" ,"title":"Steampunked Bike","id":"1043"},{"image_url":"https://steampunk-d72.kxcdn.com/daily/4/834-vhJ2bLI9yLdGAbfGetiewA .jpg","title":"A bike made of spoons by James Rice","id":"836"},{"image_url":"https://steampunk-d72.kxcdn .com/daily/0/1490-Iqr6FlNjgRgzTRKEYMBq1A.jpg","title":"Bicycle part lamps by ilmecca produzioni ","id" :"1494"}]

...so as you can see, there are more than one entries, but for some reason it seems to "stop" after the first one:

enter image description here

At first I thought it was an issue with my code, but I'm not so sure. Maybe someone else can spot whats going on?

Line 34 in the picture above, is:

 console.log(data);

...within the loop (which is whats confusing me, as it only shows 1 dump - not several, which is what is being returned in the JSON)

Answer:1

The code below will render a <h1> and two <button>. In my expectation, the changeString1 <button> will change letString to 1 and change <h1> text to 1 finally, while the ...

The code below will render a <h1> and two <button>. In my expectation, the changeString1 <button> will change letString to 1 and change <h1> text to 1 finally, while the ...

I have two domains. [www.one.de and www.two.de] on www.one.de I have a script witch makes a ajaxcall to www.two.de/collect.php First I call on www.two.de this php-script to set a cookie: $domain ="....

I have two domains. [www.one.de and www.two.de] on www.one.de I have a script witch makes a ajaxcall to www.two.de/collect.php First I call on www.two.de this php-script to set a cookie: $domain ="....

  1. access cookies
  2. access cookies javascript
  3. access cookie from different domain
  4. access cookie react
  5. access cookie from server
  6. access cookie from iframe
  7. access cookies on iphone
  8. access cookies on android
  9. access cookie in php
  10. access cookies in angular
  11. access cookie from subdomain
  12. access cookies in jquery
  13. access cookies express
  14. access cookies in html
  15. access cookies on ipad
  16. access cookies from chrome extension
  17. access cookie in jsp
  18. access cookies from service worker
  19. access cookies from another domain
  20. access cookies in c#

I was trying the below commands on Chrome console. I am able to create the object using new(line 2 below) but using call doesn't work. Can anyone explain what could be the reason ? function ...

I was trying the below commands on Chrome console. I am able to create the object using new(line 2 below) but using call doesn't work. Can anyone explain what could be the reason ? function ...

I have the following method to paste some HTML at the caret position, using `range.insertNode(), sourced from this SO answer function insertAtCursor(html) { var sel, range; if (window....

I have the following method to paste some HTML at the caret position, using `range.insertNode(), sourced from this SO answer function insertAtCursor(html) { var sel, range; if (window....

  1. paste html at caret