var fileextension = ".jpg";
$(document).ready(function(){
//for(i = 2; i < <?php echo $imgCount ?>; i++) {
$.ajax({
//This will retrieve the contents of the folder if the folder is configured as 'browsable'
url: dir,
success: function (data) {
alert(data);
$(data).find("a:contains(.jpg)").each(function () {
alert(data);
var filename = $(this).attr("href");
$("body").append("<img src='" + dir + filename + "'>");
});
}
});
->is there any problem with this dode? because on success i got data and also call alert(data) function successfully but after that $(data).find("a:contains(.jpg)").each(function () {
alert(data);
var filename = $(this).attr("href");
$("body").append("<img src='" + dir + filename + "'>"); this function not invoke
data doesn't exist outside the success function
Обсуждают сегодня