これは、PHPでのJSON Freebaseの結果の解析に由来しますが、 JSONP を使用してJavascriptで実行できるため、その方法を知りたいと思います。
したがって、私はこのjqueryオートコンプリートプラグインを使用しています:http://devthought.com/wp-content/projects/jquery/textboxlist/Demo/
これは、入力でプラグインを使用するためのコードです。
$(function() {
var t = new $.TextboxList('#form_topick_tags', {unique: true, plugins: {autocomplete: {
minLength: 2,
queryRemote: true,
remote: {url: 'autocomplete2.php'}
}}});
Freebaseの結果を解析したいと思います。例:http: //www.freebase.com/private/suggest?prefix = beatles&type_strict = any&category = object&all_types = false&start = 0&limit = 10&callback =
そしてそれをこの順序でプラグインに渡します:
guid,"name",null,"name<span>n:type name</span>"
したがって、最初の結果は次のようになります。
0,"The Beatles",null,"The Beatles<span>Band</span>"