我正在使用Saber Rest API创建一个票务预订系统。因此,我已经使用Ajax发送了一个请求并得到了响应。现在,我想根据下图显示特定的数组元素。我已经搜索了CMB到DUB机场。在这次旅行中,有1个中间站即AUH机场。如果旅途中有1个以上的中间站,我希望将它们显示在始发地和目的地机场之间。共有30,50个回应。因此,它需要使用for或任何方法进行循环。
我尝试了很多方法。但是,我无法做到。我该怎么办??
实际的响应对象很大,因此我在这里附加了Google Drive Link
这是“查看页面图片”。
这是查看页面的代码。
<!-- start detail -->
<div id="collapseMore_01" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body row well_8">
<div class="scrollbar" id="style-4">
<div class="force-overflow">
<div class="col-md-12 01">
<div class="col-md-5">
<p class="f_out">Outbound <span class="space_1"></span> <small>Origin(CMB) - Destination(DUB) | 1 middle stop(AUH)</small> <span class="space_1"></span> </p>
</div>
<div class="col-md-7">
<p class=""><small class="f_green">Early fly </small>|<small class="f_orange"> Quickcel</small></p>
</div>
<div class="more_01">
<div class="col-md-12">
<p class="f_ghi">
<small class="f_gh">Origin - CMB</small><span class="space_1"></span>Colombo, Sri Lanka
</p>
</div>
<div class="col-md-12">
<div class="col-md-3">
<p class="col-md-6 time_01">
5h 15m
</p>
<div class="col-md-6">
<img class="img-responsive" src="assets/img/flight/emirates_logo.png" />
<p class="f_con">Air Line</p>
</div>
</div>
<div class="col-md-6">
<div class="col-md-6">
<p class="">Origin Departure Date</p>
</div>
<div class="col-md-6 cvbn">
<a href="#"><i class="material-icons">airline_seat_legroom_normal</i></a>
<a href="#"><i class="material-icons">wifi</i></a>
<a href="#"><i class="material-icons">ondemand_video</i></a>
<a href="#"><i class="material-icons">power</i></a>
<a href="#"><i class="material-icons">restaurant</i> </a>
</div>
<div class="col-md-6">
<p class="">12.45 <small>am</small> - 5.30 <small>am</small></p>
</div>
<div class="col-md-6">
<p class=""><img src="assets/img/flight/baggage@3x.png" class="img-responsive" style="display: unset; width: 9px;" />
<small class="f_kg">40 Kg</small><span class="space_1"></span>
<small>2 pc
<i class="material-icons" style="font-size: 14px;">info</i>
</small>
</p>
</div>
</div>
<div class="col-md-3">
<p class="f_ty">
Economy
</p>
<p class="f_ty">
Narrow body
</p>
<p class="f_ty">
Boeing 777-300ER
</p>
</div>
</div>
</div>
<div class="more_02">
<div class="col-md-6">
<p class="f_ghi">
<small class="f_gh">If Middle stops have - AUH</small><span class="space_1"></span>
</p>
</div>
<div class="col-md-6">
<p class="f_ghi_r">
<small class="f_ghr">Layover 8h</small><span class="space_1"></span>High
</p>
</div>
<div class="col-md-12">
<div class="col-md-3">
<p class="col-md-6 time_01">
5h 15m
</p>
<div class="col-md-6">
<img class="img-responsive" src="assets/img/flight/emirates_logo.png" />
<p class="f_con">Emirates</p>
</div>
</div>
<div class="col-md-6">
<div class="col-md-6">
<p class="">Departure Date Middle Stop</p>
</div>
<div class="col-md-6 cvbn">
<a href="#"><i class="material-icons">airline_seat_legroom_normal</i></a>
<a href="#"><i class="material-icons">wifi</i></a>
<a href="#"><i class="material-icons">ondemand_video</i></a>
<a href="#"><i class="material-icons">power</i></a>
<a href="#"><i class="material-icons">restaurant</i> </a>
</div>
<div class="col-md-6">
<p class="">12.45 <small>am</small> - 5.30 <small>am</small></p>
</div>
<div class="col-md-6">
<p class=""><img src="assets/img/flight/baggage@3x.png" class="img-responsive" style="display: unset; width: 9px;" />
<small class="f_kg">40 Kg</small><span class="space_1"></span>
<small>2 pc
<i class="material-icons" style="font-size: 14px;">info</i>
</small>
</p>
</div>
</div>
<div class="col-md-3">
<p class="f_ty">
Economy
</p>
<p class="f_ty">
Narrow body
</p>
<p class="f_ty">
Boeing 777-300ER
</p>
</div>
</div>
<div class="col-md-6">
<p class="f_ghi">
<small class="f_gh">Destination - DUB</small><span class="space_1"></span>
</p>
</div>
</div>
</div>
<br>
<div class="col-md-12 01" style="margin-top: 20px;">
<div class="col-md-5">
<p class="f_out">Inbound<span class="space_1"></span> <small>DUB - CMB</small> <span class="space_1"></span> <small>19m 05m</small> </p>
</div>
<div class="col-md-7">
<p class=""><small class="f_green">Early fly </small>|<small class="f_orange"> Quickcel</small></p>
</div>
<div class="more_01">
<div class="col-md-12">
<p class="f_ghi">
<small class="f_gh">Return Origin - DUB</small><span class="space_1"></span>
</p>
</div>
<div class="col-md-12">
<div class="col-md-3">
<p class="col-md-6 time_01">
5h 15m
</p>
<div class="col-md-6">
<img class="img-responsive" src="assets/img/flight/emirates_logo.png" />
<p class="f_con">Emirates</p>
</div>
</div>
<div class="col-md-6">
<div class="col-md-6">
<p class="">Return Departure Date</p>
</div>
<div class="col-md-6 cvbn">
<a href="#"><i class="material-icons">airline_seat_legroom_normal</i></a>
<a href="#"><i class="material-icons">wifi</i></a>
<a href="#"><i class="material-icons">ondemand_video</i></a>
<a href="#"><i class="material-icons">power</i></a>
<a href="#"><i class="material-icons">restaurant</i> </a>
</div>
<div class="col-md-6">
<p class="">12.45 <small>am</small> - 5.30 <small>am</small></p>
</div>
<div class="col-md-6">
<p class=""><img src="assets/img/flight/baggage@3x.png" class="img-responsive" style="display: unset; width: 9px;" />
<small class="f_kg">40 Kg</small><span class="space_1"></span>
<small>2 pc
<i class="material-icons" style="font-size: 14px;">info</i>
</small>
</p>
</div>
</div>
<div class="col-md-3">
<p class="f_ty">
Economy
</p>
<p class="f_ty">
Narrow body
</p>
<p class="f_ty">
Boeing 777-300ER
</p>
</div>
</div>
</div>
<div class="more_02">
<div class="col-md-6">
<p class="f_ghi">
<small class="f_gh">If return middle stops have - AUH</small><span class="space_1"></span>
</p>
</div>
<div class="col-md-6">
<p class="f_ghi_y">
<small class="f_ghr">Layover 4h</small><span class="space_1"></span>Medium
</p>
</div>
<div class="col-md-12">
<div class="col-md-3">
<p class="col-md-6 time_01">
5h 15m
</p>
<div class="col-md-6">
<img class="img-responsive" src="assets/img/flight/emirates_logo.png" />
<p class="f_con">Emirates</p>
</div>
</div>
<div class="col-md-6">
<div class="col-md-6">
<p class="">Return Middle stop departure Date</p>
</div>
<div class="col-md-6 cvbn">
<a href="#"><i class="material-icons">airline_seat_legroom_normal</i></a>
<a href="#"><i class="material-icons">wifi</i></a>
<a href="#"><i class="material-icons">ondemand_video</i></a>
<a href="#"><i class="material-icons">power</i></a>
<a href="#"><i class="material-icons">restaurant</i> </a>
</div>
<div class="col-md-6">
<p class="">12.45 <small>am</small> - 5.30 <small>am</small></p>
</div>
<div class="col-md-6">
<p class=""><img src="assets/img/flight/baggage@3x.png" class="img-responsive" style="display: unset; width: 9px;" />
<small class="f_kg">40 Kg</small><span class="space_1"></span>
<small>2 pc
<i class="material-icons" style="font-size: 14px;">info</i>
</small>
</p>
</div>
</div>
<div class="col-md-3">
<p class="f_ty">
Economy
</p>
<p class="f_ty">
Narrow body
</p>
<p class="f_ty">
Boeing 777-300ER
</p>
</div>
</div>
<div class="col-md-6">
<p class="f_ghi">
<small class="f_gh">Return Destination - CMB </small><span class="space_1"></span>
</p>
</div>
</div>
</div> </div>
</div>
</div>
</div>
<!-- end more details-->