I'm wondering that how API results can load as response comes.
similar functionality
I think using ajax from database we can get. But here from API(live results) SOAP API.
any suggestions?
EDIT
My current ajax function is
$.ajax({
type: "get",
url: "<?=base_url()?>search/showresults",
cache: false,
data:datastring,
beforeSend:function(){
$('#resultloader').show();
},
success: function(response){
$('#resultloader').hide(500);
$('#showflightresults').html(response);
},
error: function(){
//alert('Error while Sending request..');
}
});
Thank you
Try setting dataType as xml
and processData as false
and check.
$.ajax({
type: "get",
url: "<?=base_url()?>search/showresults",
cache: false,
data:datastring,
processData: false,
dataType:"xml",
beforeSend:function(){
$('#resultloader').show();
},
success: function(response){
$('#resultloader').hide(500);
$('#showflightresults').html(response);
},
error: function(){
//alert('Error while Sending request..');
}
});
EDIT:-
You need to iterate through php array.
var arrayFromPHP = <?php echo json_encode($arrayPHP) ?>;
$.each(arrayFromPHP, function (i, elem) {
// do your stuff
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With