This works great at retrieving the php data for say 15 passes BUT when the json file is say 100 items it chokes the php script and creates random errors. My guess is because the requests are all made from this singe ajax request (faster than the php script works) the php script is getting confused?
$(document).ready(function(){
var ajax_load = "<div class='loadwrap'><img class='load' src='/img/load.gif' style='width:12px;' alt='' /> fetching list...</div>";
$("#status").html(ajax_load);
$.getJSON('/fsbo/get_urls_24_hours', function(data) {
$("#alias").fadeOut('slow');
var ajax_load = "<div class='loadwrap'><img class='load' src='/img/load.gif' style='width:12px;' alt='' /> fetching property...</div>";
$('#props').html('');
$.each(data, function(key, val) {
$.ajax({
type: "POST",
url: base_url + "/fsbo/get_property",
data: "url="+ val,
cache:false,
success:
function(data){
$("<div></div>").html(data).appendTo('#props');
}
});
});
});
});
As a side note where do I put the hide loading gif? Putting it at the end of the loop does no good it just opens and closes not waiting for the return of data.