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.
Comments
Post a Comment