由于項目需要下拉并且能搜索,所以想著使用select2.js 可是使用中需要從后臺獲取下拉的數(shù)據(jù) 看不懂是如何使用的,文檔中這樣使用地址中獲取的數(shù)據(jù)格式是什么樣的呢?現(xiàn)在我已經(jīng)拿到數(shù)據(jù) 不需要這樣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 };}},
select2下拉的使用
烙印99
2018-08-26 08:06:00
