I want to get files list (from a folder named uploads
.
get_files.php
<?php
$dir = 'uploads/';
$a = scandir($dir);
$b=count($a);
for($x=2;$x<$b;$x++)
{
echo"<div class='filePass'>";
echo $a[$x];
echo "</div>";
}
?>
get_files.php
works well as alone, i.e. it properly lists the files.
But how can I get the list inside insideT
div ?
I can include get-files.php
but I need to do this using jquery ajax, because of reusing the function later.
function get_files(){
$.ajax({
url : 'get_files.php',
type : 'get'
});
$('#insideT').html(//here I want to get the file listing);
}
get_files();