【发布时间】:2020-11-08 20:09:21
【问题描述】:
我正在尝试添加/附加我对 AJAX 请求的响应 (here is the response) 到带有类列表组的 div。你能告诉我怎么做吗?
我不知道如何在这里添加代码,所以我会添加照片。
My code。链接返回this,我需要每个结果的matching_full_name 部分。
我不知道要寻找什么来创建解决方案。我尝试附加href,但失败得很惨。
This 是预期结果。
$('.form-control').keyup(function(event) {
var input = $(this).val();
console.log(input);
$.ajax({
url: 'https://api.teleport.org/api/cities/',
type: 'GET',
data: 'json',
data: {search: input},
success: function(response) {
// I dont know what to write here
HTML 在这里
<body>
<div class="form-group">
<input type="text" class="form-control" placeholder="Enter a city..."
<hr>
<div class="list-group"></div>
【问题讨论】:
标签: java ajax livesearch