Custom box with autocomplete from Google/Bing. Is there any way to read the received json file?

守給你的承諾、 提交于 2019-12-03 17:14:12

A working demo full : http://jsfiddle.net/LxXJz/

This uses: http://api.bing.net/qson.aspx

or

Here you go "test" like this Demo : http://jsfiddle.net/zNUBc/

Flick your whole code, or a fiddle I might sort it out for you :) Hope this demo help you.

code

var url = 'http://api.bing.com/osjson.aspx?JsonType=callback&JsonCallback=?';
$.getJSON(url, {
    query: 'hulk'
}, function (data) {
    document.write(data)
});

Update 16 hours latter :)

Here is the solution using : http://api.bing.com/osjson.aspx

Demo => http://jsfiddle.net/pW6LZ/

see this screeshot carefully:

Luz-Brillante

Updated Code that works after the update by bing:

success: function (data) {
    console.log(data);
    var suggestions = [];
    $.each(data[1], function (i, val) {
        suggestions.push(val);
    });
    //This returns the top 5 suggestions, instead of a list of over 20 suggestions.
    response(suggestions.slice(0, 5));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!