由于项目需要下拉并且能搜索,所以想着使用select2.js 可是使用中需要从后台获取下拉的数据 看不懂是如何使用的,文档中这样使用地址中获取的数据格式是什么样的呢?现在我已经拿到数据 不需要这样ajax使用 但是获取的[{},{},{}]该如何放到下拉中呢 。。。自己水平有限,希望大牛解释下ajax:{url:"https://api.github.com/search/repositories", dataType:'json',quietMillis:250,data:function(term, page){return{q: term,page: page };},results:function(data, page){var more =(page *30)< data.total_count;return{ results: data.items, more: more };}},
添加回答
举报
0/150
提交
取消