用于自动完成 jquery 插件的 JSONP Freebase
这来自 用 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>"
This comes from Parse JSON Freebase results in PHP
But since its possible to do it in Javascript using JSONP, I would liek to know how.
So, I'm using this jquery Autocomplete plugin: http://devthought.com/wp-content/projects/jquery/textboxlist/Demo/
This is the code for using the plugin on an input:
$(function() {
var t = new $.TextboxList('#form_topick_tags', {unique: true, plugins: {autocomplete: {
minLength: 2,
queryRemote: true,
remote: {url: 'autocomplete2.php'}
}}});
I would like to parse the results from Freebase, e.g. http://www.freebase.com/private/suggest?prefix=beatles&type_strict=any&category=object&all_types=false&start=0&limit=10&callback=
and pass it to the plugin in this order:
guid,"name",null,"name<span>n:type name</span>"
So, the first result would be:
0,"The Beatles",null,"The Beatles<span>Band</span>"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)