jquery - Javascript Typeahead set JSON properly -


i trying putting work:

http://www.tutorialrepublic.com/codelab.php?topic=bootstrap&file=typeahead-with-external-dataset

but don't seem write json properly, have done way successfuly:

http://www.tutorialrepublic.com/codelab.php?topic=bootstrap&file=typeahead-with-local-dataset

but not json format (i have new json have read , tried couple of ways carry out without success.)

so, json (countries.json) in same file javascript calls it.

{"countries": [  {'accounts':'audi', 'accounts':'bmw', 'accounts':'bugatti', 'accounts':'ferrari','accounts': 'ford'}  ]} 

and javascript:

$(document).ready(function(){     $('input.typeahead').typeahead({         name: 'accounts',         prefetch: 'countries.json',         limit: 10     }); });   

thank in advance

change content of countries.json this, , work ok.

['audi', 'bmw', 'bugatti', 'ferrari', 'ford', 'lamborghini', 'mercedes benz', 'porsche', 'rolls-royce', 'volkswagen'] 

seem typeahead store result in localstorage, have clear localstorage make sure works. enter image description here


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -