簡體   English   中英

在PHP中重新加載頁面以顯示圖像

[英]Reload Page In PHP To Display Image

我在PHP中有這樣的代碼:

<div class="row" id="buttons">
<?php
    for ($i = 0; $i < $n; $i++) {
        $path = 'miniatura' . $camera_array[$i]['cameraId'] . '.jpeg';
        $fp = fopen($path, 'w');
        fwrite($fp, $get_miniature);
        fclose($fp);
        echo '<div class="thumbnail" style="float:left;display:inline;" id="little"><img src="' . $path . '"/></div>';
    } 
?>
</div>

我想用我的代碼重新加載DIV以在5秒內刷新圖片。 在Internet上,我找到了JQuery load()方法並編寫了以下JavaScript:

<script type="text/javascript">
    var auto_refresh = setInterval(
    function ()
        {
            $('#buttons').load(location.href+ " #little");
        },5000);
</script>

但這是行不通的。 怎么了? 請幫忙。

嘗試刪除" #little"之前的" #little"

$('#buttons').load(location.href+ "#little");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM