I am loading images from folder but problem is

first loading div after storing images.

Because of this problem i have to increase loading time div.

<script type="text/javascript">
$(function() {
  $("#snap").click(function() {
     $("#myweb").load("webcamsnap.php")
  })
})
</script>

You can try this

window.setTimeout(function() {
    $("#myweb").load("webcamsnap.php");
}, 2000);

Inside your function. It will make the load wait 2 seconds before actually executing it.

Excellent Ewald Horn,,,

Very Thanx

KK problem is solved but one more problem is there.

I am getting first snap using webcam, but second time clicking snap button
"first image coming and at the same time appending first images with 1st image and 2nd image"

any body help me i dont want append images while loading

my code is retrieving images

<div class="row"><label class="col-xs-2">Click On  Ultimate Image</label><div class="col-xs-10"> <?php
$folder = 'webcam/';
$filetype = '*.jpg';
$files = glob($folder.$filetype);
$count = count($files);

echo '<table><tr>';
$sortedArray = array();
for ($i = 0; $i < $count; $i++) {
$sortedArray[date ('YmdHis', filemtime($files[$i]))] = $files[$i];


/*print_r($sortedArray);
krsort($sortedArray);
print_r($sortedArray);*/
foreach ($sortedArray as &$filename) {
#echo '<br>' . $filename;
echo '<td>';
echo '<a  name="'.$filename.'" href="oflinereg.php?imagename='.$filename.'"><img height="100px" width="150px" src="'.$filename.'" /></a>';
$imagename=substr($filename,strlen($folder),strpos($filename, '.')-strlen($folder));
echo '</td>';
}
}
echo '</tr>';
echo '</table>';
?>
</div>
</div>

and loading div is

<script type="text/javascript">
$(function() {
  $("#snap").click(function() {
  window.setTimeout(function() {
     $("#myweb").load("webcamsnap.php");
     }, 5000);
  })
})
</script>

any body help me while clicking total images come from folder not apped to previous image.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.