-1
我有一个DIV中一个主要DIV我有6个不同的表,它表明API我从阿贾克斯节目表的结果,因为它的载入完成,从Ajax调用获取数据
调用的API的响应的事情是不每个API都会一直给出结果,所以我需要相应地显示
现在我正在使用.hide
和.show
以获得特定的结果表。
问题是,如果我从第二个API获取数据,它将显示第二个位置的表格,之后,如果5,6获得响应,他们现在显示的是如果我获得3,4 API响应他们会在两者之间得到空间,我希望将3,4结果附加到列表中。
因此,对于用户(前端),它们显示为所有apis都在逐个响应并逐个显示数据。
<div class="insight text-center">
<table id="ssl_table" class="table table-hover" style="color: black; position: relative; z-index: 1000; background: white;">
</table>
<table id="links_table" class="table table-hover" style="color: black; position: relative; z-index: 1000; background: white;">
</table>
<table id="tag_table" class="table table-hover" style="color: black; position: relative; z-index: 1000; background: white;">
</table>
<table id="drupal_table" class="table table-hover" style="color: black; position: relative; z-index: 1000; background: white;">
</table>
<table id="wp_table" class="table table-hover" style="color: black; position: relative; z-index: 1000; background: white;">
</table>
<table id="zx_table" class="table table-hover" style="color: black; position: relative; z-index: 1000; background: white;">
</table>
<table id="ada_table" class="table table-hover" style="color: black; position: relative; z-index: 1000; background: white;">
</table>
</div>
我有6阿贾克斯这样
$.ajax({
"async": true,
"crossDomain": true,
"url": "api_url",
"method": "POST",
"headers": {
"content-type": "application/x-www-form-urlencoded"
},
"data": {
"url": "website_url
}
}
).done(function (response) {
if (response.current) {
$('#wp_table').show();
} else {
$('#wp_table').hide();
console.log('Error :',response)
}
}).fail(function (jqXHR, response) {
$('#wp_table').hide();
console.log('Failed',response);
});
}
向我们展示您的脚本部分,您正在显示/隐藏表格 –
添加了ajax,其中im显示了表格@SanchitPatiyal –