Questions tagged «jquery-select2-3»

7
Select2 Ajax方法未选择
好的,我确定这里有一个简单的设置错误,但我不是100%是错的。 因此,我尝试使用Select2 AJAX方法作为用户搜索数据库并选择结果的方式。通话本身会返回结果,但是不允许我从列表中选择答案。它似乎也不允许您在悬停或上/下箭头上“选择”它。因此,事不宜迟,这是我的代码: index.html <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="select2/select2.css" media="screen" /> <script src="select2/select2.js"></script> <script src="select.js"></script> </head> <body> <input type="text" style="width: 500px" class="select2"> </body> </html> select.js jQuery(function() { var formatSelection = function(bond) { console.log(bond) return bond.name } var formatResult = function(bond) { return '<div class="select2-user-result">' + bond.name + …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.