Hi i have a problem i was using usbwebserver for my localhost but i had to switch to xampp because of php 5.5. But now is one of my functions misbehaving. It shows only 2/6 pictures from directory and i don't know why. It's function that will add an image to my body when clicked on that image. No errors on page found.
var pom = document.getElementById("ImageAdd");
pom.style.visibility = "visible";
var dir = "uploads";
var fileextension = [".png", ".jpeg", ".jpg", ".gif"];
$.ajax({
url: dir,
success: function(data) {
for (var i = 0; i < fileextension.length; i++) {
$(data).find("a:contains(" + fileextension[i] + ")").each(function() {
var filename = this.href.replace(window.location.host, "").replace("http://", "");
$("#ImageAdd").append("<img src=\"" + dir + filename + "\" onclick=\"addimg('" + dir + filename + "')\">");
});
}
}
});